Package org.ametys.core.user
Class User
java.lang.Object
org.ametys.core.user.User
- All Implemented Interfaces:
Principal
Implementation of the principal abstraction to represent an user with a login
and eventually a fullname and an email.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration for the user creation origin -
Field Summary
Modifier and TypeFieldDescriptionprotected ZonedDateTime
The creation dateprotected User.UserCreationOrigin
The creation originprotected String
The email of this principal.protected String
The first name of this principal.protected UserIdentity
The identity of this principal.protected String
The last name of this principal.protected UserDirectory
The user directory this user belongs to. -
Constructor Summary
ConstructorDescriptionConstruct 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.User
(UserIdentity identity, String lastName, String firstName, String email, UserDirectory userDirectory, ZonedDateTime creationDate, User.UserCreationOrigin creationOrigin) Construct a new UserPrincipal, associated with a last name, a first name, an email and identified by a login. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getFullName
(boolean firstLast) The full name of the user represented by this Principal.boolean
Test if two principal are equals.Get the user's creation dateGet the user's creation origingetEmail()
The email of the user represented by this Principal.The first name of the userThe fullname of this user.The identity of the user.The last name of the usergetName()
The fullname to use to display if sort is needed.The user directory this user belongs to.int
hashCode()
toString()
Return a String representation of this object, which exposes only information that should be public.
-
Field Details
-
_identity
The identity of this principal. -
_lastName
The last name of this principal. -
_firstName
The first name of this principal. -
_email
The email of this principal. -
_creationDate
The creation date -
_creationOrigin
The creation origin -
_userDirectory
The user directory this user belongs to.
-
-
Constructor Details
-
User
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
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.
-
User
public User(UserIdentity identity, String lastName, String firstName, String email, UserDirectory userDirectory, ZonedDateTime creationDate, User.UserCreationOrigin creationOrigin) 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 emailcreationDate
- the creation datecreationOrigin
- the creation originuserDirectory
- The user directory the use rbelongs to. Can be null.
-
-
Method Details
-
getIdentity
The identity of the user.- Returns:
- The identity.
-
getName
-
getLastName
The last name of the user- Returns:
- The last name.
-
getFirstName
The first name of the user- Returns:
- The first name.
-
getEmail
The email of the user represented by this Principal.- Returns:
- The email.
-
getFullName
The fullname of this user.- Returns:
- The full name
-
getSortableName
The fullname to use to display if sort is needed. Ensure the sort will be on- Returns:
- The sortable name
-
getUserDirectory
The user directory this user belongs to.- Returns:
- The user directory
-
getCreationDate
Get the user's creation date- Returns:
- the creation date
-
getCreationOrigin
Get the user's creation origin- Returns:
- the creation origin
-
_getFullName
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
Return a String representation of this object, which exposes only information that should be public. -
equals
Test if two principal are equals. -
hashCode
-