com.atlassian.crowd.security.demo.model
Class DemoUser
java.lang.Object
com.atlassian.crowd.security.demo.model.DemoUser
- All Implemented Interfaces:
- User, DirectoryEntity, java.lang.Comparable<User>, java.security.Principal
public class DemoUser
- extends java.lang.Object
- implements User
Constructor Summary |
DemoUser(java.lang.String name,
java.lang.String firstName,
java.lang.String lastName,
boolean active,
java.lang.String emailAddress,
java.lang.String displayName,
long directoryId)
|
Method Summary |
int |
compareTo(User user)
CompareTo must be compatible with the equals() and hashCode() methods |
boolean |
equals(java.lang.Object o)
Implementations must ensure equality based on
getDirectoryId() and case-insensitive getName(). |
long |
getDirectoryId()
|
java.lang.String |
getDisplayName()
|
java.lang.String |
getEmailAddress()
|
java.lang.String |
getFirstName()
|
java.lang.String |
getLastName()
|
java.lang.String |
getName()
|
int |
hashCode()
Implementations must produce a hashcode based on
getDirectoryId() and case-insensitive getName(). |
boolean |
isActive()
|
static DemoUser |
newInstance(java.lang.String name,
java.lang.String firstName,
java.lang.String lastName,
boolean active,
java.lang.String email,
java.lang.String displayName)
Creates a new user. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Principal |
toString |
DemoUser
public DemoUser(java.lang.String name,
java.lang.String firstName,
java.lang.String lastName,
boolean active,
java.lang.String emailAddress,
java.lang.String displayName,
long directoryId)
getFirstName
public java.lang.String getFirstName()
getLastName
public java.lang.String getLastName()
getDirectoryId
public long getDirectoryId()
- Specified by:
getDirectoryId
in interface User
- Specified by:
getDirectoryId
in interface DirectoryEntity
- Returns:
- id of the directory in which the DirectoryEntity 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 java.lang.String getEmailAddress()
- Specified by:
getEmailAddress
in interface User
- Returns:
- email address of the user.
getDisplayName
public java.lang.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 User
- Specified by:
compareTo
in interface java.lang.Comparable<User>
getName
public java.lang.String getName()
- Specified by:
getName
in interface DirectoryEntity
- Specified by:
getName
in interface java.security.Principal
- Returns:
- name of the entity.
equals
public boolean equals(java.lang.Object o)
- Description copied from interface:
DirectoryEntity
- 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 java.security.Principal
- Overrides:
equals
in class java.lang.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:
DirectoryEntity
- 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 java.security.Principal
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- hashcode.
newInstance
public static DemoUser newInstance(java.lang.String name,
java.lang.String firstName,
java.lang.String lastName,
boolean active,
java.lang.String email,
java.lang.String displayName)
- Creates a new user.
Copyright © 2010 Atlassian. All Rights Reserved.