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 booleanequals(java.lang.Object o)java.time.LocalDateTimegetCreationDate()Returns the date and time the Account was initially created.java.time.LocalDateTimegetPasswordExpirationDate()Returns the expiration date of the current password.java.lang.StringgetUsername()Returns the username.inthashCode()booleanhasPasswordExpiration()Returnstrueif a password expiration date is set.booleanisLocked()Returnstrueif this Account is locked and thus cannot be used to login.booleanisPasswordExpired()Returns whether or not the Account's password is expired.java.lang.StringtoString()
-
-
-
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:
getUsernamein interfaceAuthenticationInfo- Returns:
- the username
-
isLocked
public boolean isLocked()
Returnstrueif this Account is locked and thus cannot be used to login.- Specified by:
isLockedin interfaceAuthenticationInfo- Returns:
trueif 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:
isPasswordExpiredin 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:
getCreationDatein 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:
getPasswordExpirationDatein interfaceAuthenticationInfo- Returns:
- the expiration date of the current password
- Since:
- 1.5.0
-
hasPasswordExpiration
public boolean hasPasswordExpiration()
Returnstrueif a password expiration date is set.- Specified by:
hasPasswordExpirationin interfaceAuthenticationInfo- Returns:
trueif a password expiration date is set.- Since:
- 1.5.0
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-