Package org.spongepowered.api.util
Enum Class Tristate
- All Implemented Interfaces:
- Serializable,- Comparable<Tristate>,- Constable
Represents a simple tristate.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum Constants
- 
Method SummaryModifier and TypeMethodDescriptionabstract TristateANDs this tristate with another tristate.booleanReturns the boolean representation of this tristate.@Nullable BooleanReturns the nullable boolean representation of this tristate, whereUNDEFINEDequates to null.static TristatefromBoolean(boolean val) Returns the appropriate tristate for a given boolean value.static TristatefromNullableBoolean(@Nullable Boolean val) Returns the appropriate tristate for a given nullable boolean value, where null equates toUNDEFINED.abstract Tristatenot()Negates this tristate.abstract TristateORs this tristate with another tristate.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- 
TRUE
- 
FALSE
- 
UNDEFINED
 
- 
- 
Method Details- 
valuesReturns 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
 
- 
valueOfReturns 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
 
- 
fromBooleanReturns the appropriate tristate for a given boolean value.- Parameters:
- val- The boolean value
- Returns:
- The appropriate tristate
 
- 
fromNullableBooleanReturns the appropriate tristate for a given nullable boolean value, where null equates toUNDEFINED.- Parameters:
- val- The nullable boolean value
- Returns:
- The appropriate tristate
 
- 
andANDs this tristate with another tristate.- Parameters:
- other- The tristate to AND with
- Returns:
- The result
 
- 
orORs this tristate with another tristate.- Parameters:
- other- The tristate to OR with
- Returns:
- The result
 
- 
notNegates this tristate.- Returns:
- The result
 
- 
asBooleanpublic boolean asBoolean()Returns the boolean representation of this tristate.- Returns:
- The boolean tristate representation
 
- 
asNullableBooleanReturns the nullable boolean representation of this tristate, whereUNDEFINEDequates to null.Note: To ensure that there is a one-to-one mapping of nullable booleans to and from Tristate, this method will return null rather than use anOptional.- Returns:
- The nullable boolean tristate representation
 
 
-