Enum Class MutexState

java.lang.Object
java.lang.Enum<MutexState>
org.tasktide.mutex.model.MutexState
All Implemented Interfaces:
Serializable, Comparable<MutexState>, Constable

public enum MutexState extends Enum<MutexState>
Enum of valid states for distributed lock
  • Enum Constant Details

    • INITIALIZATION

      public static final MutexState INITIALIZATION
    • WAITING

      public static final MutexState WAITING
    • HOST_LOCKED

      public static final MutexState HOST_LOCKED
    • LOCKED

      public static final MutexState LOCKED
    • RELEASED

      public static final MutexState RELEASED
    • OPEN

      public static final MutexState OPEN
  • Method Details

    • values

      public static MutexState[] 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 MutexState 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
    • isLockState

      public abstract boolean isLockState(String query)
      Abstract method check if query is enum value
      Parameters:
      query -
      Returns:
      boolean
    • isLockState

      public abstract boolean isLockState(MutexState query)
      Abstract method check if query is enum value
      Parameters:
      query -
      Returns:
      boolean
    • indexOf

      public static int indexOf(String query)
      Fetch the index for mapped query string
      Parameters:
      query -
      Returns:
      >0/-1
    • hasQuery

      public static boolean hasQuery(String query)
      Check if query maps to enum value
      Parameters:
      query -
      Returns:
      boolean
    • get

      public static MutexState get(String query)
      Map query to enum value
      Parameters:
      query -
      Returns:
      MutexState
    • valuesString

      public static String valuesString()
      Represent enum as string
      Returns:
      String