Class DelegatingUserWithAttributes

java.lang.Object
com.atlassian.crowd.embedded.impl.AbstractDelegatingEntityWithAttributes
com.atlassian.crowd.embedded.impl.DelegatingUserWithAttributes
All Implemented Interfaces:
Attributes, User, UserWithAttributes, Comparable<User>, Principal
Direct Known Subclasses:
DelegatingUserWithAttributes

public class DelegatingUserWithAttributes extends AbstractDelegatingEntityWithAttributes implements UserWithAttributes
Implementation of UserWithAttributes that simply delegates to an underlying User and Attributes object.

Instances of this class will be effectively immutable so long as either:

  • It is constructed with immutable objects.
  • Or, the mutable objects it is constructed with are not "leaked".
  • Constructor Details

    • DelegatingUserWithAttributes

      public DelegatingUserWithAttributes(User user, Attributes attributes)
  • Method Details

    • getDirectoryId

      public long getDirectoryId()
      Specified by:
      getDirectoryId in interface User
      Returns:
      id of the directory in which the User is stored.
    • isActive

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

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

      public String getDisplayName()
      Specified by:
      getDisplayName in interface User
      Returns:
      display name (eg. full name) of the user, must never be null.
    • 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
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • equals

      public boolean equals(Object o)
      Description copied from interface: User
      Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().
      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 name.toLowerCase() of the directory entities match.
    • hashCode

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