Enum Class State

java.lang.Object
java.lang.Enum<State>
org.kiwiproject.consul.model.State
All Implemented Interfaces:
Serializable, Comparable<State>, Constable

public enum State extends Enum<State>
Represents the possible Check states.
  • Enum Constant Details

    • PASS

      public static final State PASS
    • WARN

      public static final State WARN
    • FAIL

      public static final State FAIL
    • ANY

      public static final State ANY
    • UNKNOWN

      public static final State UNKNOWN
  • Method Details

    • values

      public static State[] 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 State 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
    • getPath

      public String getPath()
      Retrieve the path value for the Consul check API endpoints.
      Returns:
      The path value, e.g. "pass" for PASS.
    • getName

      public String getName()
      Retrieve the name value for the Consul check API endpoints. This is the value to use for querying services by health state.
      Returns:
      The name, e.g. "passing" for PASS.
    • fromName

      public static State fromName(String name)
      Returns the appropriate State given the name.
      Parameters:
      name - The state name e.g. "passing".
      Returns:
      The state.