Package com.atlassian.crowd.model.user
Class DelegatingUserWithAttributes
java.lang.Object
com.atlassian.crowd.embedded.impl.AbstractDelegatingEntityWithAttributes
com.atlassian.crowd.embedded.impl.DelegatingUserWithAttributes
com.atlassian.crowd.model.user.DelegatingUserWithAttributes
- All Implemented Interfaces:
Attributes
,User
,UserWithAttributes
,DirectoryEntity
,User
,UserWithAttributes
,Comparable<User>
,Principal
public class DelegatingUserWithAttributes
extends DelegatingUserWithAttributes
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
CompareTo must be compatible with the equals() and hashCode() methodsboolean
Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().int
hashCode()
Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().Methods inherited from class com.atlassian.crowd.embedded.impl.DelegatingUserWithAttributes
getDirectoryId, getDisplayName, getEmailAddress, getName, isActive
Methods inherited from class com.atlassian.crowd.embedded.impl.AbstractDelegatingEntityWithAttributes
getKeys, getValue, getValues, isEmpty
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
Methods inherited from interface com.atlassian.crowd.model.DirectoryEntity
getDirectoryId, getName
Methods inherited from interface com.atlassian.crowd.embedded.api.User
getDirectoryId, getDisplayName, getEmailAddress, isActive, isMarkedAsDeleted
-
Constructor Details
-
DelegatingUserWithAttributes
-
-
Method Details
-
getFirstName
- Specified by:
getFirstName
in interfaceUser
-
getLastName
- Specified by:
getLastName
in interfaceUser
-
equals
Description copied from interface:User
Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().- Specified by:
equals
in interfaceDirectoryEntity
- Specified by:
equals
in interfacePrincipal
- Specified by:
equals
in interfaceUser
- Overrides:
equals
in classDelegatingUserWithAttributes
- 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 interfaceDirectoryEntity
- Specified by:
hashCode
in interfacePrincipal
- Specified by:
hashCode
in interfaceUser
- Overrides:
hashCode
in classDelegatingUserWithAttributes
- Returns:
- hashcode.
-
compareTo
Description copied from interface:User
CompareTo must be compatible with the equals() and hashCode() methods- Specified by:
compareTo
in interfaceComparable<User>
- Specified by:
compareTo
in interfaceUser
- Overrides:
compareTo
in classDelegatingUserWithAttributes
-
getExternalId
- Specified by:
getExternalId
in interfaceUser
-