public enum Tristate extends Enum<Tristate>
Enum Constant and Description |
---|
FALSE
A value indicating a negative (negated) setting.
|
TRUE
A value indicating a positive setting.
|
UNDEFINED
A value indicating a non-existent setting.
|
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
Returns the value of the Tristate as a boolean.
|
static Tristate |
fromBoolean(boolean val)
Returns a
Tristate from a boolean. |
static Tristate |
fromNullableBoolean(@Nullable Boolean val)
Returns a
Tristate from a nullable boolean. |
static Tristate |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Tristate[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Tristate TRUE
public static final Tristate FALSE
public static final Tristate UNDEFINED
public static Tristate[] values()
for (Tristate c : Tristate.values()) System.out.println(c);
public static Tristate valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Tristate fromNullableBoolean(@Nullable Boolean val)
Tristate
from a nullable boolean.
Unlike fromBoolean(boolean)
, this method returns UNDEFINED
if the value is null.
public boolean asBoolean()
A value of UNDEFINED
converts to false.