Package com.kii.cloud.storage
Class IdentityData.Builder
- java.lang.Object
-
- com.kii.cloud.storage.IdentityData.Builder
-
- Enclosing class:
- IdentityData
public static class IdentityData.Builder extends java.lang.Object
Builder forIdentityData
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IdentityData
build()
Build IdentityData from this builder.static IdentityData.Builder
newWithEmail(java.lang.String email)
Create Builder with email address.static IdentityData.Builder
newWithName(java.lang.String userName)
Create Builder with user name.static IdentityData.Builder
newWithPhone(java.lang.String phone)
Create Builder with phone number.IdentityData.Builder
withEmail(java.lang.String email)
Build with email address.IdentityData.Builder
withName(java.lang.String userName)
Build with user name.IdentityData.Builder
withPhone(java.lang.String phone)
Build with phone number.
-
-
-
Method Detail
-
newWithName
@NonNull public static IdentityData.Builder newWithName(@NonNull java.lang.String userName)
Create Builder with user name.- Parameters:
userName
- Name of the user.- Returns:
- IdentityDataBuilder instance. You can call
withEmail(String)
,withPhone(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the user name is invalid. For details refer toKiiUser.isValidUserName(String)
-
newWithEmail
@NonNull public static IdentityData.Builder newWithEmail(@NonNull java.lang.String email)
Create Builder with email address.- Parameters:
email
- Email address of the user.- Returns:
- IdentityDataBuilder instance. You can call
withName(String)
,withPhone(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the email address is invalid. For details refer toKiiUser.isValidEmail(String)
-
newWithPhone
@NonNull public static IdentityData.Builder newWithPhone(@NonNull java.lang.String phone)
Create Builder with phone number. You can set both global and local phone number. If you set local phone number, you must set country code byUserFields.putCountry(String)
when putting identity usingKiiUser.putIdentity(IdentityData, UserFields, String)
.- Parameters:
phone
- Phone number of the user. We'll remove the separators(i.e dot(.) or hyphen(-)), if these are present in the specified number.- Returns:
- IdentityDataBuilder instance. You can call
withEmail(String)
,withName(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the phone number is invalid. For details refer toKiiUser.isValidPhone(String)
-
withName
@NonNull public IdentityData.Builder withName(@NonNull java.lang.String userName)
Build with user name. When called multiple times, it will update existing user name.- Parameters:
userName
- Name of the user.- Returns:
- IdentityDataBuilder instance. You can call
withEmail(String)
,withPhone(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the user name is invalid. For details refer toKiiUser.isValidUserName(String)
-
withEmail
@NonNull public IdentityData.Builder withEmail(@NonNull java.lang.String email)
Build with email address. When called multiple times, it will update existing email address.- Parameters:
email
- Email address of the user.- Returns:
- IdentityDataBuilder instance. You can call
withName(String)
,withPhone(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the email address is invalid. For details refer toKiiUser.isValidEmail(String)
-
withPhone
@NonNull public IdentityData.Builder withPhone(@NonNull java.lang.String phone)
Build with phone number. When called multiple times, it will update existing phone number. You can set both global and local phone number. If you set local phone number, you must set country code byUserFields.putCountry(String)
when putting identity usingKiiUser.putIdentity(IdentityData, UserFields, String)
.- Parameters:
phone
- Phone number of the user. We'll remove the separators(i.e dot(.) or hyphen(-)), if these are present in the specified number.- Returns:
- IdentityDataBuilder instance. You can call
withEmail(String)
,withName(String)
continuously. - Throws:
java.lang.IllegalArgumentException
- when the phone number is invalid. For details refer toKiiUser.isValidPhone(String)
andKiiUser.isValidLocalPhone(String)
-
build
@NonNull public IdentityData build()
Build IdentityData from this builder.- Returns:
- IdentityData instance
-
-