java.lang.Object
org.litebridge.commons.BooleanUtils
Utility class for boolean operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanrequireFalse(boolean value, String message) Ensures that a given boolean value isfalse.static booleanrequireTrue(boolean value, String message) Ensures that a given boolean value istrue.static booleanConverts aBooleanobject to a primitiveboolean.
-
Method Details
-
toBoolean
Converts aBooleanobject to a primitiveboolean.- Parameters:
value- theBooleanobject to be converted, which may benull.- Returns:
trueif the input value isBoolean.TRUE, otherwisefalse.
-
requireTrue
Ensures that a given boolean value istrue. If the value isfalse, throws anIllegalArgumentExceptionwith the specified message.- Parameters:
value- the boolean value to checkmessage- the exception message to use if the value isfalse- Returns:
trueif the value istrue- Throws:
IllegalArgumentException- if the value isfalse
-
requireFalse
Ensures that a given boolean value isfalse. If the value istrue, throws anIllegalArgumentExceptionwith the specified message.- Parameters:
value- the boolean value to checkmessage- the exception message to use if the value istrue- Returns:
falseif the value isfalse- Throws:
IllegalArgumentException- if the value istrue
-