Class EmbeddedCrowdUser

java.lang.Object
com.atlassian.crowd.embedded.atlassianuser.EmbeddedCrowdUser
All Implemented Interfaces:
com.atlassian.crowd.embedded.api.User, com.atlassian.user.Entity, com.atlassian.user.User, Serializable, Comparable<com.atlassian.crowd.embedded.api.User>, Principal

public class EmbeddedCrowdUser extends Object implements com.atlassian.user.User, com.atlassian.crowd.embedded.api.User
An implementation of both the Atlassian-User User interface and the Crowd User interface, used to bridge the two APIs.

Where the contracts of the two APIs differ, like with equals(Object) behaviour, the Crowd API is followed.

See Also:
  • Constructor Details

    • EmbeddedCrowdUser

      public EmbeddedCrowdUser(long directoryId, String name, String displayName, String emailAddress, boolean isActive)
      Constructs a new EmbeddedCrowdUser with the specified properties. The name must not be null.
      Throws:
      NullPointerException - if the provided name is null
    • EmbeddedCrowdUser

      public EmbeddedCrowdUser(long directoryId, String name, String displayName, String emailAddress)
      Constructs a new active EmbeddedCrowdUser with the specified properties. The name must not be null. The user's active property will be set to true.
      Throws:
      NullPointerException - if the provided name is null
    • EmbeddedCrowdUser

      public EmbeddedCrowdUser(com.atlassian.crowd.embedded.api.User crowdUser)
      Constructs a new Embedded Crowd user with a copy of the properties from the provided user.
      Parameters:
      crowdUser - a user from Crowd, which must not be null and must not have a null name
      Throws:
      NullPointerException - if the user or its name is null
  • Method Details

    • getFullName

      public String getFullName()
      Specified by:
      getFullName in interface com.atlassian.user.User
    • getEmail

      public String getEmail()
      Specified by:
      getEmail in interface com.atlassian.user.User
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface com.atlassian.crowd.embedded.api.User
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface com.atlassian.user.User
    • getEmailAddress

      public String getEmailAddress()
      Specified by:
      getEmailAddress in interface com.atlassian.crowd.embedded.api.User
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface com.atlassian.crowd.embedded.api.User
    • compareTo

      public int compareTo(com.atlassian.crowd.embedded.api.User user)
      Specified by:
      compareTo in interface Comparable<com.atlassian.crowd.embedded.api.User>
      Specified by:
      compareTo in interface com.atlassian.crowd.embedded.api.User
    • getDirectoryId

      public final long getDirectoryId()
      Specified by:
      getDirectoryId in interface com.atlassian.crowd.embedded.api.User
    • getName

      public final String getName()
      Specified by:
      getName in interface com.atlassian.user.Entity
      Specified by:
      getName in interface Principal
    • toString

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

      public final boolean equals(Object o)
      Specified by:
      equals in interface Principal
      Specified by:
      equals in interface com.atlassian.crowd.embedded.api.User
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Specified by:
      hashCode in interface Principal
      Specified by:
      hashCode in interface com.atlassian.crowd.embedded.api.User
      Overrides:
      hashCode in class Object