Record Class LicenseInfo

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.LicenseInfo
Record Components:
state - the current LicenseStatus
edition - the product edition (e.g. "Enterprise"), or null when unlicensed
licensee - the licensee name, or null when unlicensed
features - the enabled feature flags (never null; empty when unlicensed)
expiresAt - the expiry as Unix seconds, or null for perpetual / unlicensed

public record LicenseInfo(LicenseStatus state, String edition, String licensee, List<String> features, Long expiresAt) extends Record
A snapshot of the engine's licensing status.
  • Constructor Details

    • LicenseInfo

      public LicenseInfo(LicenseStatus state, String edition, String licensee, List<String> features, Long expiresAt)
      Creates an instance of a LicenseInfo record class.
      Parameters:
      state - the value for the state record component
      edition - the value for the edition record component
      licensee - the value for the licensee record component
      features - the value for the features record component
      expiresAt - the value for the expiresAt record component
  • Method Details

    • hasFeature

      public boolean hasFeature(String feature)
      Whether this license enables feature ("*" is a wildcard).
    • isLicensed

      public boolean isLicensed()
      Whether a valid license is in force (LicenseStatus.LICENSED or LicenseStatus.GRACE).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • state

      public LicenseStatus state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • edition

      public String edition()
      Returns the value of the edition record component.
      Returns:
      the value of the edition record component
    • licensee

      public String licensee()
      Returns the value of the licensee record component.
      Returns:
      the value of the licensee record component
    • features

      public List<String> features()
      Returns the value of the features record component.
      Returns:
      the value of the features record component
    • expiresAt

      public Long expiresAt()
      Returns the value of the expiresAt record component.
      Returns:
      the value of the expiresAt record component