Package org.geysermc.geyser.api.util
Enum Class TriState
- All Implemented Interfaces:
Serializable,Comparable<TriState>,Constable
This is a way to represent a boolean, but with a non set value added.
This class was inspired by adventure's TriState
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic TriStatefromBoolean(boolean value) Creates a TriState from a primitive boolean.static TriStatefromBoolean(@Nullable Boolean value) Creates a TriState from a boolean.@Nullable BooleanConverts the TriState to a boolean.static TriStateReturns the enum constant of this class with the specified name.static TriState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOT_SET
Describes a value that is not set, null, or not present. -
TRUE
Describes a true value. -
FALSE
Describes a false value.
-
-
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
-
toBoolean
Converts the TriState to a boolean.- Returns:
- the boolean value of the TriState
-
fromBoolean
Creates a TriState from a boolean.- Parameters:
value- the Boolean value- Returns:
- the created TriState
-
fromBoolean
Creates a TriState from a primitive boolean.- Parameters:
value- the boolean value- Returns:
- the created TriState
-