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 Details

    • Authorization

      public Authorization()
      Constructor.
    • Authorization

      public Authorization(Long id)
      Constructor.
      Parameters:
      id - the primary key
    • Authorization

      public Authorization(Long id, Instant created)
      Constructor.
      Parameters:
      id - the primary key
      created - the created date
    • Authorization

      public Authorization(Instant created, String token)
      Constructor.
      Parameters:
      created - the created date
      token - the token
    • Authorization

      public Authorization(Authorization other)
      Copy constructor.
      Parameters:
      other - the authorization to copy
  • Method Details

    • isSameAs

      public boolean isSameAs(Authorization other)
      Test if the properties of another entity are the same as in this instance.

      The id and created properties 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

      public boolean differsFrom(Authorization other)
      Specified by:
      differsFrom in interface net.solarnetwork.domain.Differentiable<Authorization>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isExpired

      public boolean isExpired()
      Test if this authorization has expired.
      Returns:
      true if the expiryDate property is available and is not before the current system time
    • getToken

      public String getToken()
      Get the authorization token value.
      Returns:
      the token
    • setToken

      public void setToken(String token)
      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

      public Instant getExpiryDate()
      Get the expiration date.
      Returns:
      the expiration date, or null for no expiration
    • setExpiryDate

      public void setExpiryDate(Instant expiryDate)
      Set the expiration date.
      Parameters:
      expiryDate - the expiration date to set, or null for no expiration
    • getParentId

      public String getParentId()
      Get the ID of a parent authorization.
      Returns:
      the parent ID, or null if there is no parent
    • setParentId

      public void setParentId(String parentId)
      Set the ID of a parent authorization.
      Parameters:
      parentId - the parent ID to set, or null if there is no parent