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 User
anonymousUser()
Constructs an anonymous user with a randomUserBuilder.userId
and no other identifying informationstatic UserBuilder
anonymousUserBuilder()
Constructs aUserBuilder
with an anonymous user id to allow information to be added to the modelUser
build()
Constructs aUser
with the current Builder configurationstatic UserBuilder
newBuilder(User user)
Constructs a newUserBuilder
from an existingUser
UserBuilder
setEmail(java.lang.String email)
Sets the user's emailUserBuilder
setFcmToken(java.lang.String token)
Sets the user's fcm tokenUserBuilder
setFirstName(java.lang.String firstName)
Sets the user's first nameUserBuilder
setGroupAttributes(java.util.Map<java.lang.String,java.lang.Object> groupAttributes)
Sets the user's group attributesUserBuilder
setGroupId(java.lang.String groupId)
Sets the user's group IDUserBuilder
setLastName(java.lang.String lastName)
Sets the user's last nameUserBuilder
setPhoneNumber(java.lang.String phoneNumber)
Sets the user's phone numberUserBuilder
setPreviousId(java.lang.String previousId)
Sets the previous ID for the userUserBuilder
setTimezone(java.lang.String timezone)
Sets the user's timezoneUserBuilder
setUserAttributes(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 aUser
with the current Builder configuration- Returns:
- a constructed
User
model
-
anonymousUser
public static User anonymousUser()
Constructs an anonymous user with a randomUserBuilder.userId
and no other identifying information- Returns:
- an anonymous
User
-
anonymousUserBuilder
public static UserBuilder anonymousUserBuilder()
Constructs aUserBuilder
with an anonymous user id to allow information to be added to the model- Returns:
- a
UserBuilder
with an anonymous id
-
newBuilder
public static UserBuilder newBuilder(User user)
Constructs a newUserBuilder
from an existingUser
- Parameters:
user
- an instance ofUser
- Returns:
- an instance of a
UserBuilder
-
-