public class BooleanUtils extends Object
Operations on boolean primitives and Boolean objects.
This class tries to handle null
input gracefully.
An exception will not be thrown for a null
input.
Each method documents its behaviour in more detail.
Constructor and Description |
---|
BooleanUtils() |
Modifier and Type | Method and Description |
---|---|
static Boolean |
toBooleanObject(boolean bool)
Boolean factory that avoids creating new Boolean objecs all the time.
|
public static Boolean toBooleanObject(boolean bool)
Boolean factory that avoids creating new Boolean objecs all the time.
This method was added to JDK1.4 but is available here for earlier JDKs.
BooleanUtils.toBooleanObject(false) = Boolean.FALSE BooleanUtils.toBooleanObject(true) = Boolean.TRUE
bool
- the boolean to convert