Class UserBuilder



  • public class UserBuilder
    extends java.lang.Object
    • Constructor Detail

      • UserBuilder

        public UserBuilder(java.lang.String userId)
    • 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 a User with the current Builder configuration
        Returns:
        a constructed User model
      • anonymousUser

        public static User anonymousUser()
        Constructs an anonymous user with a random UserBuilder.userId and no other identifying information
        Returns:
        an anonymous User
      • anonymousUserBuilder

        public static UserBuilder anonymousUserBuilder()
        Constructs a UserBuilder with an anonymous user id to allow information to be added to the model
        Returns:
        a UserBuilder with an anonymous id
      • aliased

        public static User aliased(User user,
                                   java.lang.String aliasId)
        Aliases the given user with the provided alias Id
        Parameters:
        user - the user to be aliased
        aliasId - the alias id
        Returns:
        the new aliased user