Enum Class FlagState

java.lang.Object
java.lang.Enum<FlagState>
de.z0rdak.yawp.core.flag.FlagState
All Implemented Interfaces:
Serializable, Comparable<FlagState>, Constable

public enum FlagState extends Enum<FlagState>
  • Enum Constant Details

    • DISABLED

      public static final FlagState DISABLED
      The flag is disabled, duh!
    • ALLOWED

      public static final FlagState ALLOWED
      The flag is allowed and implicitly active.
    • DENIED

      public static final FlagState DENIED
      The flag is denied and implicitly active.
    • UNDEFINED

      public static final FlagState UNDEFINED
      The flag is undefined and thus not present in a flag container.
      This state is used to indicate that a flag is not set during flag checks.
      It is not accessible for users to set this state.
      See Also:
  • Field Details

    • name

      public final String name
  • Method Details

    • values

      public static FlagState[] 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 FlagState 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
    • from

      public static FlagState from(boolean value)
    • from

      public static FlagState from(String value) throws IllegalArgumentException
      Converts a string to a flag state.
      Allowed values are: ALLOWED, DENIED, DISABLED, UNDEFINED
      Parameters:
      value - the string to convert
      Returns:
      the corresponding flag state
      Throws:
      IllegalArgumentException - if the value is invalid
    • ValidFlagStates

      public static List<String> ValidFlagStates()
      List of valid flag states for CLI to set the flag state. Undefined is excluded because it should not be accessible for users.
      Returns:
      list of valid flag states
    • validLoggingStates

      public static boolean validLoggingStates(String flagState)
    • invert

      public static FlagState invert(FlagState state)