com.atlassian.crowd.model.user
Class InternalUserWithAttributes

java.lang.Object
  extended by com.atlassian.crowd.model.EntityWithAttributes
      extended by com.atlassian.crowd.model.user.InternalUserWithAttributes
All Implemented Interfaces:
Attributes, User, UserWithAttributes, DirectoryEntity, Comparable<User>, Principal

public class InternalUserWithAttributes
extends EntityWithAttributes
implements UserWithAttributes

Encapsulates the concept of user which has attributes.


Constructor Summary
InternalUserWithAttributes(InternalUser user, Map<String,Set<String>> attributes)
           
 
Method Summary
 int compareTo(User o)
          CompareTo must be compatible with the equals() and hashCode() methods
 boolean equals(Object o)
          Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().
 PasswordCredential getCredential()
           
 long getDirectoryId()
           
 String getDisplayName()
           
 String getEmailAddress()
           
 String getFirstName()
           
 InternalUser getInternalUser()
           
 String getLastName()
           
 String getName()
           
 int hashCode()
          Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().
 boolean isActive()
           
 
Methods inherited from class com.atlassian.crowd.model.EntityWithAttributes
getKeys, getValue, getValues, isEmpty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.embedded.api.Attributes
getKeys, getValue, getValues, isEmpty
 

Constructor Detail

InternalUserWithAttributes

public InternalUserWithAttributes(InternalUser user,
                                  Map<String,Set<String>> attributes)
Method Detail

getDirectoryId

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

getName

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

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.

getFirstName

public String getFirstName()

getLastName

public String getLastName()

getDisplayName

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

getInternalUser

public InternalUser getInternalUser()

getCredential

public PasswordCredential getCredential()

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 User
Specified by:
equals in interface DirectoryEntity
Specified by:
equals in interface Principal
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 User
Specified by:
hashCode in interface DirectoryEntity
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
hashcode.

compareTo

public int compareTo(User o)
Description copied from interface: User
CompareTo must be compatible with the equals() and hashCode() methods

Specified by:
compareTo in interface User
Specified by:
compareTo in interface Comparable<User>


Copyright © 2012 Atlassian. All Rights Reserved.