Class Booleans
java.lang.Object
com.pnfsoftware.jeb.util.primitives.Booleans
Utility methods for boolean objects and primitives.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanNull safe equals method.static booleanTest whether a boxed Boolean is non-null and false.static booleanTest whether a boxed Boolean is non-null and true.static booleanConvert a boxed Boolean to a primitive boolean.
-
Constructor Details
-
Booleans
public Booleans()
-
-
Method Details
-
isTrue
Test whether a boxed Boolean is non-null and true.- Parameters:
object- boxed Boolean- Returns:
- true if the object is
Boolean.TRUE
-
isFalse
Test whether a boxed Boolean is non-null and false.- Parameters:
object- boxed Boolean- Returns:
- true if the object is
Boolean.FALSE
-
toBoolean
Convert a boxed Boolean to a primitive boolean.- Parameters:
object- boxed Boolean- Returns:
- true if the object is non-null and true
-
equals
Null safe equals method.- Parameters:
object1- first Boolean, may be nullobject2- second Boolean, may be null- Returns:
- true if both values are null or equal
-