Package org.ametys.core.user
Class User
- java.lang.Object
-
- org.ametys.core.user.User
-
-
Field Summary
Fields Modifier and Type Field Description protected String_emailThe email of this principal.protected String_firstNameThe first name of this principal.protected UserIdentity_identityThe identity of this principal.protected String_lastNameThe last name of this principal.protected UserDirectory_userDirectoryThe user directory this user belongs to.
-
Constructor Summary
Constructors Constructor Description User(String login, String populationId)Construct a new UserPrincipal, associated with the specified login et population id.User(UserIdentity identity)Construct a new UserPrincipal, associated with the specified identity.User(UserIdentity identity, String lastName, String firstName, String email, UserDirectory userDirectory)Construct a new UserPrincipal, associated with a last name, a first name, an email and identified by a login.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_getFullName(boolean firstLast)The full name of the user represented by this Principal.booleanequals(Object another)Test if two principal are equals.StringgetEmail()The email of the user represented by this Principal.StringgetFirstName()The first name of the userStringgetFullName()The fullname of this user.UserIdentitygetIdentity()The identity of the user.StringgetLastName()The last name of the userStringgetName()StringgetSortableName()The fullname to use to display if sort is needed.UserDirectorygetUserDirectory()The user directory this user belongs to.inthashCode()StringtoString()Return a String representation of this object, which exposes only information that should be public.
-
-
-
Field Detail
-
_identity
protected UserIdentity _identity
The identity of this principal.
-
_firstName
protected String _firstName
The first name of this principal.
-
_userDirectory
protected UserDirectory _userDirectory
The user directory this user belongs to.
-
-
Constructor Detail
-
User
public User(String login, String populationId)
Construct a new UserPrincipal, associated with the specified login et population id.- Parameters:
login- The login of the principal.populationId- The id of the population
-
User
public User(UserIdentity identity)
Construct a new UserPrincipal, associated with the specified identity.- Parameters:
identity- The identity of this user. Cannot be null
-
User
public User(UserIdentity identity, String lastName, String firstName, String email, UserDirectory userDirectory)
Construct a new UserPrincipal, associated with a last name, a first name, an email and identified by a login.- Parameters:
identity- The identity of this user. Cannot be nulllastName- The last namefirstName- The first nameemail- The emailuserDirectory- The user directory the use rbelongs to. Can be null.
-
-
Method Detail
-
getIdentity
public UserIdentity getIdentity()
The identity of the user.- Returns:
- The identity.
-
getLastName
public String getLastName()
The last name of the user- Returns:
- The last name.
-
getFirstName
public String getFirstName()
The first name of the user- Returns:
- The first name.
-
getEmail
public String getEmail()
The email of the user represented by this Principal.- Returns:
- The email.
-
getFullName
public String getFullName()
The fullname of this user.- Returns:
- The full name
-
getSortableName
public String getSortableName()
The fullname to use to display if sort is needed. Ensure the sort will be on- Returns:
- The sortable name
-
getUserDirectory
public UserDirectory getUserDirectory()
The user directory this user belongs to.- Returns:
- The user directory
-
_getFullName
protected String _getFullName(boolean firstLast)
The full name of the user represented by this Principal.- Parameters:
firstLast- Define the name order if the full name. If true, first name then last name. If false, the contrary.- Returns:
- The full name.
-
toString
public String toString()
Return a String representation of this object, which exposes only information that should be public.
-
-