Enum Class StateEnum

java.lang.Object
java.lang.Enum<StateEnum>
org.apache.juneau.commons.lang.StateEnum
All Implemented Interfaces:
Serializable, Comparable<StateEnum>, Constable

public enum StateEnum extends Enum<StateEnum>
Enumeration of state machine states for use in parsing operations.

This enum provides a standardized set of state constants (S1 through S50) that can be used in state machine implementations throughout the Juneau codebase. This eliminates the need to declare local int constants and provides better code readability.

Examples:

import static org.apache.juneau.commons.utils.StateEnum.*; // Use in state machine var state = S1; if (state == S1) { // Handle state S1 }

See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static StateEnum[] 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 StateEnum 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
    • isAny

      public boolean isAny(StateEnum... states)
      Returns true if the state is any one of the specified states.
      Parameters:
      states - The states to check.
      Returns:
      true if the state is any one of the specified states.