Package com.helger.commons.state
Interface ITriState
- All Known Implementing Classes:
ETriState
public interface ITriState
Base interface for the tri state.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionConvert the tri state value into aBooleanvalue, depending on what "undefined" means.default BooleangetAsBooleanObj(boolean bUndefinedValue) Convert the tri state value into aBooleanvalue, depending on what "undefined" means.getAsBooleanObj(Boolean aUndefinedValue) Convert the tri state value into aBooleanvalue, depending on what "undefined" means.booleanConvert the tri state value into a boolean value.booleangetAsBooleanValue(boolean bUndefinedValue) Convert the tri state value into a boolean value, depending on what "undefined" means.booleanbooleanisFalse()booleanisTrue()default boolean
-
Method Details
-
isTrue
boolean isTrue()- Returns:
trueif the value istrue.
-
isFalse
boolean isFalse()- Returns:
trueif the value isfalse
-
isDefined
boolean isDefined()- Returns:
trueif the value is not undefined (if it is eithertrueorfalse)
-
isUndefined
default boolean isUndefined()- Returns:
trueif the value is undefined (if it is neithertruenorfalse)
-
getAsBooleanValue
boolean getAsBooleanValue()Convert the tri state value into a boolean value. If it is undefined, anIllegalStateExceptionis thrown.- Returns:
trueifisTrue()is true,falseifisFalse()is true, or an exception otherwise!- Throws:
IllegalStateException- If this is undefined- See Also:
-
getAsBooleanValue
boolean getAsBooleanValue(boolean bUndefinedValue) Convert the tri state value into a boolean value, depending on what "undefined" means. -
getAsBooleanObj
Convert the tri state value into aBooleanvalue, depending on what "undefined" means.- Returns:
Boolean.TRUEifisTrue()istrue,Boolean.FALSEifisFalse()istrue, ornull!
-
getAsBooleanObj
Convert the tri state value into aBooleanvalue, depending on what "undefined" means.- Parameters:
bUndefinedValue- Therepresentation of undefined.invalid reference
boolean- Returns:
Boolean.TRUEifisTrue()is true,Boolean.FALSEifisFalse()is true, or otherwise the passed parameter!
-
getAsBooleanObj
Convert the tri state value into aBooleanvalue, depending on what "undefined" means.- Parameters:
aUndefinedValue- TheBooleanrepresentation of undefined.- Returns:
Boolean.TRUEifisTrue()is true,Boolean.FALSEifisFalse()is true, or otherwise the passed parameter!
-