Package com.jgcomptech.tools.authc
Class SimpleAuthenticationInfo
- java.lang.Object
-
- com.jgcomptech.tools.authc.SimpleAuthenticationInfo
-
- All Implemented Interfaces:
AuthenticationInfo
,java.io.Serializable
public class SimpleAuthenticationInfo extends java.lang.Object implements AuthenticationInfo
A simple implementation of the AuthenticationInfo interface.- Since:
- 1.5.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleAuthenticationInfo()
Default no-argument constructor.SimpleAuthenticationInfo(java.lang.String username, boolean locked, java.time.LocalDateTime creationDate, java.time.LocalDateTime passwordExpirationDate, boolean hasPasswordExpiration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.time.LocalDateTime
getCreationDate()
Returns the date and time the Account was initially created.java.time.LocalDateTime
getPasswordExpirationDate()
Returns the expiration date of the current password.java.lang.String
getUsername()
Returns the username.int
hashCode()
boolean
hasPasswordExpiration()
Returnstrue
if a password expiration date is set.boolean
isLocked()
Returnstrue
if this Account is locked and thus cannot be used to login.boolean
isPasswordExpired()
Returns whether or not the Account's password is expired.java.lang.String
toString()
-
-
-
Constructor Detail
-
SimpleAuthenticationInfo
public SimpleAuthenticationInfo()
Default no-argument constructor.
-
SimpleAuthenticationInfo
public SimpleAuthenticationInfo(java.lang.String username, boolean locked, java.time.LocalDateTime creationDate, java.time.LocalDateTime passwordExpirationDate, boolean hasPasswordExpiration)
-
-
Method Detail
-
getUsername
public java.lang.String getUsername()
Returns the username.- Specified by:
getUsername
in interfaceAuthenticationInfo
- Returns:
- the username
-
isLocked
public boolean isLocked()
Returnstrue
if this Account is locked and thus cannot be used to login.- Specified by:
isLocked
in interfaceAuthenticationInfo
- Returns:
true
if this Account is locked and thus cannot be used to login
-
isPasswordExpired
public boolean isPasswordExpired()
Returns whether or not the Account's password is expired. This usually indicates that the password would need to changed before the account could be used.- Specified by:
isPasswordExpired
in interfaceAuthenticationInfo
- Returns:
- whether or not the Account's credentials are expired
- Since:
- 1.5.0 changed implementation
-
getCreationDate
public java.time.LocalDateTime getCreationDate()
Returns the date and time the Account was initially created.- Specified by:
getCreationDate
in interfaceAuthenticationInfo
- Returns:
- the date and time the Account was initially created
- Since:
- 1.5.0
-
getPasswordExpirationDate
public java.time.LocalDateTime getPasswordExpirationDate()
Returns the expiration date of the current password.- Specified by:
getPasswordExpirationDate
in interfaceAuthenticationInfo
- Returns:
- the expiration date of the current password
- Since:
- 1.5.0
-
hasPasswordExpiration
public boolean hasPasswordExpiration()
Returnstrue
if a password expiration date is set.- Specified by:
hasPasswordExpiration
in interfaceAuthenticationInfo
- Returns:
true
if a password expiration date is set.- Since:
- 1.5.0
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-