Package com.atlassian.crowd.model.user
Class UserTemplate
java.lang.Object
com.atlassian.crowd.model.user.UserTemplate
- All Implemented Interfaces:
User
,DirectoryEntity
,User
,Serializable
,Comparable<User>
,Principal
- Direct Known Subclasses:
UserTemplateWithAttributes
A publicly mutable User implementation.
Used to create or update a user.
- See Also:
-
Constructor Summary
ConstructorDescriptionUserTemplate
(User user) Build a template from an existing user.UserTemplate
(User user) Build a template from an existing user.UserTemplate
(String name) UserTemplate
(String username, long directoryId) Build a template for a new user.UserTemplate
(String username, String firstName, String lastName, String displayName) -
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().long
getName()
int
hashCode()
Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().boolean
isActive()
void
setActive
(boolean active) void
setDirectoryId
(long directoryId) void
setDisplayName
(String displayName) void
setEmailAddress
(String emailAddress) void
setExternalId
(String externalId) void
setFirstName
(String firstName) void
setLastName
(String lastName) void
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.crowd.embedded.api.User
isMarkedAsDeleted
-
Constructor Details
-
UserTemplate
Build a template for a new user.Used to create a user.
- Parameters:
username
- username of new user.directoryId
- ID of the directory in which to store the new user.
-
UserTemplate
-
UserTemplate
Build a template from an existing user.Used to update a user.
- Parameters:
user
- user to build template from.
-
UserTemplate
-
UserTemplate
Build a template from an existing user.Used to update a user.
- Parameters:
user
- user to build template from.
-
-
Method Details
-
setDirectoryId
public void setDirectoryId(long directoryId) -
setName
-
getDirectoryId
public long getDirectoryId()- Specified by:
getDirectoryId
in interfaceDirectoryEntity
- Specified by:
getDirectoryId
in interfaceUser
- Returns:
- id of the directory in which the DirectoryEntity is stored.
-
isActive
public boolean isActive() -
setActive
public void setActive(boolean active) -
getName
- Specified by:
getName
in interfaceDirectoryEntity
- Specified by:
getName
in interfacePrincipal
- Returns:
- name of the entity.
-
getEmailAddress
- Specified by:
getEmailAddress
in interfaceUser
- Returns:
- email address of the user.
-
setEmailAddress
-
getFirstName
- Specified by:
getFirstName
in interfaceUser
-
setFirstName
-
getLastName
- Specified by:
getLastName
in interfaceUser
-
setLastName
-
getDisplayName
- Specified by:
getDisplayName
in interfaceUser
- Returns:
- display name (eg. full name) of the user, must never be null.
-
setDisplayName
-
equals
Description copied from interface:DirectoryEntity
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 classObject
- 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(). -
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
-
getExternalId
- Specified by:
getExternalId
in interfaceUser
-
setExternalId
-
toString
-