Package de.z0rdak.yawp.core.flag
Enum Class FlagState
- All Implemented Interfaces:
Serializable,Comparable<FlagState>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic FlagStatefrom(boolean value) static FlagStateConverts a string to a flag state.static FlagStateList of valid flag states for CLI to set the flag state.static booleanvalidLoggingStates(String flagState) static FlagStateReturns the enum constant of this class with the specified name.static FlagState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISABLED
The flag is disabled, duh! -
ALLOWED
The flag is allowed and implicitly active. -
DENIED
The flag is denied and implicitly active. -
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
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
from
-
from
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
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
-
invert
-