Package africa.absa.inception.security
Class User
- java.lang.Object
-
- africa.absa.inception.security.User
-
- All Implemented Interfaces:
Serializable
@Entity public class User extends Object implements Serializable
The User class holds the information for a user.- Author:
- Marcus Portmann
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description User()Constructs a new User.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)Indicates whether some other object is "equal to" this one.LocalDateTimegetCreated()Returns the date and time the user was created.StringgetEmail()Returns the e-mail address for the user.Set<Group>getGroups()Returns the groups the user is associated with.UUIDgetId()Returns the Universally Unique Identifier (UUID) for the user.StringgetMobileNumber()Returns the international format mobile number for the user.StringgetName()Returns the name of the user.StringgetPassword()Returns the password or password hash for the user.IntegergetPasswordAttempts()Returns the number of failed authentication attempts as a result of an incorrect password for the user.LocalDateTimegetPasswordExpiry()Returns the date and time the password for the user expires.StringgetPhoneNumber()Returns the phone number for the user.StringgetPreferredName()Returns the preferred name for the user.UserStatusgetStatus()Returns the status for the user.LocalDateTimegetUpdated()Returns the date and time the user was last updated.UUIDgetUserDirectoryId()Returns the Universally Unique Identifier (UUID) for the user directory the user is associated with.StringgetUsername()Returns the username for the user.inthashCode()Returns a hash code value for the object.booleanhasPasswordExpired()Has the password for the user expired?booleanisActive()Is the user active?booleanisExpired()Is the user expired?booleanisLocked()Is the user locked?protected voidonCreate()protected voidonUpdate()voidsetEmail(String email)Set the e-mail address for the user.voidsetGroups(Set<Group> groups)Set the groups the user is associated with.voidsetId(UUID id)Set the Universally Unique Identifier (UUID) for the user.voidsetMobileNumber(String mobileNumber)Set the international format mobile number for the user.voidsetName(String name)Set the name of the user.voidsetPassword(String password)Set the password or password hash for the user.voidsetPasswordAttempts(int passwordAttempts)Set the password attempts for the user.voidsetPasswordExpiry(LocalDateTime passwordExpiry)Set the date and time the password for the user expires.voidsetPhoneNumber(String phoneNumber)Set the phone number for the user.voidsetPreferredName(String preferredName)Set the preferred name for the user.voidsetStatus(UserStatus status)Set the status for the user.voidsetUserDirectoryId(UUID userDirectoryId)Set the Universally Unique Identifier (UUID) for the user directory the user is associated with.voidsetUsername(String username)Set the username for the user.
-
-
-
Method Detail
-
equals
public boolean equals(Object object)
Indicates whether some other object is "equal to" this one.
-
getCreated
public LocalDateTime getCreated()
Returns the date and time the user was created.- Returns:
- the date and time the user was created
-
getEmail
public String getEmail()
Returns the e-mail address for the user.- Returns:
- the e-mail address for the user
-
getGroups
public Set<Group> getGroups()
Returns the groups the user is associated with.- Returns:
- the groups the user is associated with
-
getId
public UUID getId()
Returns the Universally Unique Identifier (UUID) for the user.- Returns:
- the Universally Unique Identifier (UUID) for the user
-
getMobileNumber
public String getMobileNumber()
Returns the international format mobile number for the user.- Returns:
- the international format mobile number for the user
-
getName
public String getName()
Returns the name of the user.- Returns:
- the name of the user
-
getPassword
public String getPassword()
Returns the password or password hash for the user.- Returns:
- the password or password hash for the user
-
getPasswordAttempts
public Integer getPasswordAttempts()
Returns the number of failed authentication attempts as a result of an incorrect password for the user.- Returns:
- the number of failed authentication attempts as a result of an incorrect password for the user
-
getPasswordExpiry
public LocalDateTime getPasswordExpiry()
Returns the date and time the password for the user expires.- Returns:
- the date and time the password for the user expires
-
getPhoneNumber
public String getPhoneNumber()
Returns the phone number for the user.- Returns:
- the phone number for the user
-
getPreferredName
public String getPreferredName()
Returns the preferred name for the user.- Returns:
- the preferred name for the user
-
getStatus
public UserStatus getStatus()
Returns the status for the user.- Returns:
- the status for the user
-
getUpdated
public LocalDateTime getUpdated()
Returns the date and time the user was last updated.- Returns:
- the date and time the user was last updated
-
getUserDirectoryId
public UUID getUserDirectoryId()
Returns the Universally Unique Identifier (UUID) for the user directory the user is associated with.- Returns:
- the Universally Unique Identifier (UUID) for the user directory the user is associated with
-
getUsername
public String getUsername()
Returns the username for the user.- Returns:
- the username for the user
-
hasPasswordExpired
public boolean hasPasswordExpired()
Has the password for the user expired?- Returns:
- true if the password for the user has expired or false otherwise
-
hashCode
public int hashCode()
Returns a hash code value for the object.
-
isActive
public boolean isActive()
Is the user active?- Returns:
- true if the user is active or false otherwise
-
isExpired
public boolean isExpired()
Is the user expired?- Returns:
- true if the user is expired or false otherwise
-
isLocked
public boolean isLocked()
Is the user locked?- Returns:
- true if the user is locked or false otherwise
-
setEmail
public void setEmail(String email)
Set the e-mail address for the user.- Parameters:
email- the e-mail address for the user
-
setGroups
public void setGroups(Set<Group> groups)
Set the groups the user is associated with.- Parameters:
groups- the groups the user is associated with
-
setId
public void setId(UUID id)
Set the Universally Unique Identifier (UUID) for the user.- Parameters:
id- the Universally Unique Identifier (UUID) for the user
-
setMobileNumber
public void setMobileNumber(String mobileNumber)
Set the international format mobile number for the user.- Parameters:
mobileNumber- the international format mobile number for the user
-
setName
public void setName(String name)
Set the name of the user.- Parameters:
name- the name of the user
-
setPassword
public void setPassword(String password)
Set the password or password hash for the user.- Parameters:
password- the password or password hash for the user
-
setPasswordAttempts
public void setPasswordAttempts(int passwordAttempts)
Set the password attempts for the user.- Parameters:
passwordAttempts- the password attempts for the user
-
setPasswordExpiry
public void setPasswordExpiry(LocalDateTime passwordExpiry)
Set the date and time the password for the user expires.- Parameters:
passwordExpiry- the date and time the password for the user expires
-
setPhoneNumber
public void setPhoneNumber(String phoneNumber)
Set the phone number for the user.- Parameters:
phoneNumber- the phone number for the user
-
setPreferredName
public void setPreferredName(String preferredName)
Set the preferred name for the user.- Parameters:
preferredName- the preferred name for the user
-
setStatus
public void setStatus(UserStatus status)
Set the status for the user.- Parameters:
status- the status for the user
-
setUserDirectoryId
public void setUserDirectoryId(UUID userDirectoryId)
Set the Universally Unique Identifier (UUID) for the user directory the user is associated with.- Parameters:
userDirectoryId- the Universally Unique Identifier (UUID) for the user directory the user is associated with
-
setUsername
public void setUsername(String username)
Set the username for the user.- Parameters:
username- the username for the user
-
onCreate
protected void onCreate()
-
onUpdate
protected void onUpdate()
-
-