Enum Class LicenseState

java.lang.Object
java.lang.Enum<LicenseState>
com.iizix.license.v2.LicenseState
All Implemented Interfaces:
Serializable, Comparable<LicenseState>, Constable

public enum LicenseState extends Enum<LicenseState>
The state of a licence document (LICENSE-V2-DESIGN.md sections 2.2 and 7): what the MLS says about the installation at the time of issue.
Author:
Christopher Mindus
  • Enum Constant Details

    • ACTIVE

      public static final LicenseState ACTIVE
      The entitlement is active: active.
    • TRIAL

      public static final LicenseState TRIAL
      A trial, ending at trialUntil: trial.
    • DEACTIVATED

      public static final LicenseState DEACTIVATED
      The owner of the installation gave it up (7.3): deactivated.
    • REVOKED

      public static final LicenseState REVOKED
      Mindus withdrew it (7.4): revoked.
  • Method Details

    • values

      public static LicenseState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LicenseState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • token

      public String token()
      Gets the token as written in the payload.
      Returns:
      The token, e.g. active.
    • fromToken

      public static LicenseState fromToken(String token)
      Finds the state of a token.
      Parameters:
      token - The token, exactly as the payload spells it.
      Returns:
      The state, or null when the token is none of them.