Package net.solarnetwork.ocpp.domain
Class Authorization
java.lang.Object
net.solarnetwork.dao.BasicIdentity<K>
net.solarnetwork.dao.BasicEntity<Long>
net.solarnetwork.dao.BasicLongEntity
net.solarnetwork.ocpp.domain.Authorization
- All Implemented Interfaces:
Serializable,Comparable<Long>,net.solarnetwork.dao.Entity<Long>,net.solarnetwork.domain.Differentiable<Authorization>,net.solarnetwork.domain.Identity<Long>
public class Authorization
extends net.solarnetwork.dao.BasicLongEntity
implements net.solarnetwork.domain.Differentiable<Authorization>
An authorization entity.
The primary key used is the external ID value, e.g. RFID tag ID.
- Version:
- 1.1
- Author:
- matt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Authorization(Long id) Constructor.Authorization(Long id, Instant created) Constructor.Authorization(Instant created, String token) Constructor.Authorization(Authorization other) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleandiffersFrom(Authorization other) Get the expiration date.Get the ID of a parent authorization.getToken()Get the authorization token value.booleanGet the enabled flag.booleanTest if this authorization has expired.booleanisSameAs(Authorization other) Test if the properties of another entity are the same as in this instance.voidsetEnabled(boolean enabled) Set the enabled flag.voidsetExpiryDate(Instant expiryDate) Set the expiration date.voidsetParentId(String parentId) Set the ID of a parent authorization.voidSet the authorization token value.toString()Methods inherited from class net.solarnetwork.dao.BasicLongEntity
cloneMethods inherited from class net.solarnetwork.dao.BasicEntity
getCreatedMethods inherited from class net.solarnetwork.dao.BasicIdentity
compareTo, equals, getId, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Constructor Details
-
Authorization
public Authorization()Constructor. -
Authorization
Constructor.- Parameters:
id- the primary key
-
Authorization
Constructor.- Parameters:
id- the primary keycreated- the created date
-
Authorization
Constructor.- Parameters:
created- the created datetoken- the token
-
Authorization
Copy constructor.- Parameters:
other- the authorization to copy
-
-
Method Details
-
isSameAs
Test if the properties of another entity are the same as in this instance.The
idandcreatedproperties are not compared by this method.- Parameters:
other- the other entity to compare to- Returns:
- true if the properties of this instance are equal to the other
-
differsFrom
- Specified by:
differsFromin interfacenet.solarnetwork.domain.Differentiable<Authorization>
-
toString
-
isExpired
public boolean isExpired()Test if this authorization has expired.- Returns:
- true if the
expiryDateproperty is available and is not before the current system time
-
getToken
Get the authorization token value.- Returns:
- the token
-
setToken
Set the authorization token value.- Parameters:
token- the token to set
-
isEnabled
public boolean isEnabled()Get the enabled flag.- Returns:
- the enabled flag
-
setEnabled
public void setEnabled(boolean enabled) Set the enabled flag.- Parameters:
enabled- the enabled flag to set
-
getExpiryDate
Get the expiration date.- Returns:
- the expiration date, or null for no expiration
-
setExpiryDate
Set the expiration date.- Parameters:
expiryDate- the expiration date to set, or null for no expiration
-
getParentId
Get the ID of a parent authorization.- Returns:
- the parent ID, or null if there is no parent
-
setParentId
Set the ID of a parent authorization.- Parameters:
parentId- the parent ID to set, or null if there is no parent
-