Package com.zendesk.connect
Class UserBuilder
- java.lang.Object
-
- com.zendesk.connect.UserBuilder
-
public class UserBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description UserBuilder(java.lang.String userId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static UseranonymousUser()Constructs an anonymous user with a randomUserBuilder.userIdand no other identifying informationstatic UserBuilderanonymousUserBuilder()Constructs aUserBuilderwith an anonymous user id to allow information to be added to the modelUserbuild()Constructs aUserwith the current Builder configurationstatic UserBuildernewBuilder(User user)Constructs a newUserBuilderfrom an existingUserUserBuildersetEmail(java.lang.String email)Sets the user's emailUserBuildersetFcmToken(java.lang.String token)Sets the user's fcm tokenUserBuildersetFirstName(java.lang.String firstName)Sets the user's first nameUserBuildersetGroupAttributes(java.util.Map<java.lang.String,java.lang.Object> groupAttributes)Sets the user's group attributesUserBuildersetGroupId(java.lang.String groupId)Sets the user's group IDUserBuildersetLastName(java.lang.String lastName)Sets the user's last nameUserBuildersetPhoneNumber(java.lang.String phoneNumber)Sets the user's phone numberUserBuildersetPreviousId(java.lang.String previousId)Sets the previous ID for the userUserBuildersetTimezone(java.lang.String timezone)Sets the user's timezoneUserBuildersetUserAttributes(java.util.Map<java.lang.String,java.lang.Object> userAttributes)Sets the user's attributes
-
-
-
Method Detail
-
setPreviousId
public UserBuilder setPreviousId(java.lang.String previousId)
Sets the previous ID for the user- Parameters:
previousId- the previous ID for the user- Returns:
- the builder
-
setFirstName
public UserBuilder setFirstName(java.lang.String firstName)
Sets the user's first name- Parameters:
firstName- the user's first name- Returns:
- the builder
-
setLastName
public UserBuilder setLastName(java.lang.String lastName)
Sets the user's last name- Parameters:
lastName- the user's last name- Returns:
- the builder
-
setEmail
public UserBuilder setEmail(java.lang.String email)
Sets the user's email- Parameters:
email- the user's email- Returns:
- the builder
-
setPhoneNumber
public UserBuilder setPhoneNumber(java.lang.String phoneNumber)
Sets the user's phone number- Parameters:
phoneNumber- the user's phone number- Returns:
- the builder
-
setFcmToken
public UserBuilder setFcmToken(java.lang.String token)
Sets the user's fcm token- Parameters:
token- the user's fcm token- Returns:
- the builder
-
setUserAttributes
public UserBuilder setUserAttributes(java.util.Map<java.lang.String,java.lang.Object> userAttributes)
Sets the user's attributes- Parameters:
userAttributes- the user's attributes- Returns:
- the builder
-
setGroupId
public UserBuilder setGroupId(java.lang.String groupId)
Sets the user's group ID- Parameters:
groupId- the user's group ID- Returns:
- the builder
-
setGroupAttributes
public UserBuilder setGroupAttributes(java.util.Map<java.lang.String,java.lang.Object> groupAttributes)
Sets the user's group attributes- Parameters:
groupAttributes- the user's group attributes- Returns:
- the builder
-
setTimezone
public UserBuilder setTimezone(java.lang.String timezone)
Sets the user's timezone- Parameters:
timezone- the user's timezone- Returns:
- the builder
-
build
public User build()
Constructs aUserwith the current Builder configuration- Returns:
- a constructed
Usermodel
-
anonymousUser
public static User anonymousUser()
Constructs an anonymous user with a randomUserBuilder.userIdand no other identifying information- Returns:
- an anonymous
User
-
anonymousUserBuilder
public static UserBuilder anonymousUserBuilder()
Constructs aUserBuilderwith an anonymous user id to allow information to be added to the model- Returns:
- a
UserBuilderwith an anonymous id
-
newBuilder
public static UserBuilder newBuilder(User user)
Constructs a newUserBuilderfrom an existingUser- Parameters:
user- an instance ofUser- Returns:
- an instance of a
UserBuilder
-
-