NullBool¶
Enum used to return a Boolean
value with a default one should no value be set.
Enum Constant Summary¶
Enum | Description |
---|---|
TRUE |
Boolean value true |
FALSE |
Boolean value false |
NOT_SET |
Boolean value null |
Method Summary¶
Modifier and Type | Method | Description |
---|---|---|
static NullBool |
resolve(Boolean) |
Returns a NullBool instance based on the provided Boolean value. |
boolean |
isNotSet() |
Returns whether the NullBool is NullBool.NOT_SET |
boolean |
getOrDefault(boolean) |
Gets the corresponding boolean value associated with the NullBool instance. |
Enum Constant Details¶
TRUE
¶
Boolean value `true`
FALSE
¶
Boolean value `false`
NOT_SET
¶
Boolean value `null`
Method Details¶
NullBool resolve(Boolean)
¶
Returns a NullBool instance based on the provided Boolean
value.
In case of null
being provided will NullBool.NOT_SET
be returned, otherwise will the corresponding NullBool instance matching the Boolean value be returned.
Parameters:¶
Boolean: bool
- TheBoolean
value to receive a NullBool instance for.
Returns:¶
NullBool instance based on the provided Boolean
value.
boolean isNotSet()
¶
Returns whether the NullBool is NullBool.NOT_SET
Returns:¶
True if the instance is NullBool.NOT_SET
, otherwise false.
boolean getOrDefault(boolean)
¶
Gets the corresponding boolean value associated with the NullBool instance.
In the case of NullBool not being set will the provided default value be returned.
Parameters:¶
boolean: def
- The default boolean value to return should the NullBool instance beNullBool.NOT_SET
.
Returns:¶
True or false depending on the NullBool instance and the provided default value.