java.lang.Object
com.atlassian.crowd.integration.rest.entity.UserEntity
All Implemented Interfaces:
Attributes, User, UserWithAttributes, DirectoryEntity, TimestampedEntity, TimestampedUser, User, UserWithAttributes, Comparable<User>, Principal

public class UserEntity extends Object implements UserWithAttributes, TimestampedUser
Represents a User entity (client side).
Since:
v2.1
  • Constructor Details

  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface User
      Returns:
      display name (eg. full name) of the user, must never be null.
    • getFirstName

      public String getFirstName()
      Specified by:
      getFirstName in interface User
    • getLastName

      public String getLastName()
      Specified by:
      getLastName in interface User
    • getEmailAddress

      public String getEmailAddress()
      Specified by:
      getEmailAddress in interface User
      Returns:
      email address of the user.
    • getPassword

      public PasswordEntity getPassword()
    • getEncryptedPassword

      public PasswordEntity getEncryptedPassword()
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface User
      Returns:
      true if and only if the user is allowed to authenticate.
    • getName

      public String getName()
      Specified by:
      getName in interface DirectoryEntity
      Specified by:
      getName in interface Principal
      Returns:
      name of the entity.
    • getCreatedDate

      @Nullable public Date getCreatedDate()
      Description copied from interface: TimestampedEntity
      Returns the date the entity was created.
      Specified by:
      getCreatedDate in interface TimestampedEntity
      Returns:
      date the entity was created
    • getUpdatedDate

      @Nullable public Date getUpdatedDate()
      Description copied from interface: TimestampedEntity
      Returns the date the entity was last updated.
      Specified by:
      getUpdatedDate in interface TimestampedEntity
      Returns:
      date the entity was last updated.
    • setAttributes

      public void setAttributes(MultiValuedAttributeEntityList attributes)
    • getAttributes

      public MultiValuedAttributeEntityList getAttributes()
    • getValues

      public Set<String> getValues(String key)
      Description copied from interface: Attributes
      Get all the values associated with a given key. Duplicate values are not allowed, and this should be enforced case-insensitively to match the behaviour of LDAP servers. Will return null if the key does not exist.
      Specified by:
      getValues in interface Attributes
      Parameters:
      key - the key to retrieve the values for
      Returns:
      the values associated with the given key. It may return null or empty set if the key does not exist.
    • getValue

      public String getValue(String key)
      Description copied from interface: Attributes
      Returns any value associated with the given key, returns null if there is no value.
      Specified by:
      getValue in interface Attributes
      Parameters:
      key - the key to retrieve the value for
      Returns:
      any value associated with the given key, or null if there is no value
    • getKeys

      public Set<String> getKeys()
      Description copied from interface: Attributes
      Gets all the keys of the attributes. Warning: case-insensitive keys are currently no enforced, however this is the case for LDAP, so this may be implemented in the future.
      Specified by:
      getKeys in interface Attributes
      Returns:
      a set of all the keys.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Attributes
      Returns:
      true if there are no attributes
    • getDirectoryId

      @Deprecated public long getDirectoryId()
      Deprecated.
      this method has never returned the directoryId and its existence violates the directory encapsulation. It will be removed in future versions.
      Specified by:
      getDirectoryId in interface DirectoryEntity
      Specified by:
      getDirectoryId in interface User
      Returns:
      always 0
    • compareTo

      public int compareTo(User user)
      Description copied from interface: User
      CompareTo must be compatible with the equals() and hashCode() methods
      Specified by:
      compareTo in interface Comparable<User>
      Specified by:
      compareTo in interface User
    • getExternalId

      public String getExternalId()
      The user key at the server is the externalId at the client.
      Specified by:
      getExternalId in interface User
    • equals

      public boolean equals(Object o)
      Description copied from interface: DirectoryEntity
      Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().
      Specified by:
      equals in interface DirectoryEntity
      Specified by:
      equals in interface Principal
      Specified by:
      equals in interface User
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare to.
      Returns:
      true if and only if the directoryId and the lowercase names of the directory entities match.
    • hashCode

      public int hashCode()
      Description copied from interface: DirectoryEntity
      Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().
      Specified by:
      hashCode in interface DirectoryEntity
      Specified by:
      hashCode in interface Principal
      Specified by:
      hashCode in interface User
      Overrides:
      hashCode in class Object
      Returns:
      hashcode.
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
    • newMinimalInstance

      public static UserEntity newMinimalInstance(String username)
      Creates a new minimal user instance.
      Parameters:
      username - username for the user
      Returns:
      minimal user instance