Package org.kiwiproject.base
Class KiwiBooleans
java.lang.Object
org.kiwiproject.base.KiwiBooleans
Utilities for working with
Boolean wrapper objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleantoBooleanOrDefault(@Nullable Boolean booleanObject, boolean defaultValue) Return thebooleanvalue of theBooleanwhen non-null, otherwise return the default value.static booleantoBooleanOrFalse(@Nullable Boolean booleanObject) static booleantoBooleanOrTrue(@Nullable Boolean booleanObject)
-
Method Details
-
toBooleanOrTrue
- Parameters:
booleanObject- the possibly null Boolean object- Returns:
- the boolean value of the Boolean object when non-null, otherwise
true
-
toBooleanOrFalse
- Parameters:
booleanObject- the possibly null Boolean object- Returns:
- the boolean value of the Boolean object when non-null, otherwise
false
-
toBooleanOrDefault
Return thebooleanvalue of theBooleanwhen non-null, otherwise return the default value.- Parameters:
booleanObject- the possibly null Boolean objectdefaultValue- the value to use when the Boolean argument is null- Returns:
- the boolean value of the Boolean object when non-null, otherwise
defaultValue
-