public enum ETriState extends Enum<ETriState> implements IHasID<String>, ITriState
Modifier and Type | Method and Description |
---|---|
Boolean |
getAsBooleanObj()
Convert the tri state value into a
Boolean value, depending on what
"undefined" means. |
Boolean |
getAsBooleanObj(Boolean aUndefinedValue)
Convert the tri state value into a
Boolean value, depending on what
"undefined" means. |
boolean |
getAsBooleanValue()
Convert the tri state value into a boolean value.
|
boolean |
getAsBooleanValue(boolean bUndefinedValue)
Convert the tri state value into a boolean value, depending on what
"undefined" means.
|
static ETriState |
getFromIDOrDefault(String sID,
ETriState eDefault) |
static ETriState |
getFromIDOrNull(String sID) |
static ETriState |
getFromIDOrUndefined(String sID) |
String |
getID()
Get the unique ID of this object.
|
boolean |
isDefined() |
boolean |
isFalse() |
boolean |
isTrue() |
static ETriState |
valueOf(boolean bValue) |
static ETriState |
valueOf(Boolean aValue) |
static ETriState |
valueOf(ITriState aTriState) |
static ETriState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ETriState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getComparatorID
getAsBooleanObj, isUndefined
public static final ETriState TRUE
public static final ETriState FALSE
public static final ETriState UNDEFINED
public static ETriState[] values()
for (ETriState c : ETriState.values()) System.out.println(c);
public static ETriState 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 null@Nonnull @Nonempty public String getID()
IHasID
String
than the
returned value must match an XML NMToken expression (so e.g. no ':' in the
ID)!public boolean isTrue()
public boolean isFalse()
public boolean isDefined()
public boolean getAsBooleanValue()
ITriState
IllegalStateException
is thrown.getAsBooleanValue
in interface ITriState
true
if ITriState.isTrue()
is true, false
if ITriState.isFalse()
is true, or an exception otherwise!ITriState.getAsBooleanValue(boolean)
public boolean getAsBooleanValue(boolean bUndefinedValue)
ITriState
getAsBooleanValue
in interface ITriState
bUndefinedValue
- The boolean representation of undefined.true
if ITriState.isTrue()
is true, false
if ITriState.isFalse()
is true, or otherwise the passed parameter!ITriState.getAsBooleanValue()
@Nullable public Boolean getAsBooleanObj()
ITriState
Boolean
value, depending on what
"undefined" means.getAsBooleanObj
in interface ITriState
Boolean.TRUE
if ITriState.isTrue()
is true
,
Boolean.FALSE
if ITriState.isFalse()
is true
,
or null
!@Nullable public Boolean getAsBooleanObj(@Nullable Boolean aUndefinedValue)
ITriState
Boolean
value, depending on what
"undefined" means.getAsBooleanObj
in interface ITriState
aUndefinedValue
- The Boolean
representation of undefined.Boolean.TRUE
if ITriState.isTrue()
is true,
Boolean.FALSE
if ITriState.isFalse()
is true, or otherwise
the passed parameter!Copyright © 2014–2019 Philip Helger. All rights reserved.