public final class Booleans extends Object
| Modifier and Type | Field and Description |
|---|---|
static Boolean |
FALSE
The
Boolean object corresponding to the primitive value
false. |
static Boolean |
TRUE
The
Boolean object corresponding to the primitive value
true. |
| Modifier and Type | Method and Description |
|---|---|
static Boolean |
and(Boolean... bools)
Performs a logical "and" on the given values, that is, this method
returns
true if, and only if, all the given Boolean
values are true, and false in all other cases. |
static boolean |
isFalse(Boolean bool)
Returns
true if and only if the given Boolean object
is false. |
static boolean |
isNotFalse(Boolean bool)
Returns
true if and only if the given Boolean object
is not false. |
static boolean |
isNotTrue(Boolean bool)
Returns
true if and only if the given Boolean object
is not true. |
static boolean |
isTrue(Boolean bool)
Returns
true if and only if the given Boolean object
is true. |
static Boolean |
not(Boolean bool)
Returns the negation of the given
Boolean. |
static Boolean |
or(Boolean... bools)
Performs a logical "or" on the given values, that is, this method
returns
true if, and only if, at least one of the given
Boolean values is true, and false in all
other cases. |
static Integer |
toInteger(boolean bool)
Returns 1 if
bool is true, 0 otherwise. |
static Integer |
toInteger(Boolean bool)
Returns 1 if
bool is true, 0 if false. |
static String |
toString(boolean bool)
Returns the given
boolean's String representation. |
static Boolean |
valueOf(boolean bool)
Returns the
Boolean instance representing the given primitive
boolean value. |
static Boolean |
valueOf(int i)
Converts the given
int into a Boolean using the
convention that zero represents false and all other values
represent true. |
static Boolean |
valueOf(Integer i)
Converts the given
Integer into a Boolean using the
convention that zero represents false and all other values
represent true. |
static Boolean |
valueOf(String bool)
Parses the given
String into a Boolean. |
static Boolean |
xor(Boolean... bools)
Performs an "exclusive or" on the given values, that is, this method
returns
true if, and only if, only one of the given
Boolean values is true, and false in all
other cases. |
public static final Boolean TRUE
Boolean object corresponding to the primitive value
true.public static final Boolean FALSE
Boolean object corresponding to the primitive value
false.public static Boolean and(Boolean... bools)
true if, and only if, all the given Boolean
values are true, and false in all other cases.bools - the Boolean values.NullPointerException - if bools is null or if
it contains a null reference.IllegalArgumentException - if bools is empty.public static Boolean or(Boolean... bools)
true if, and only if, at least one of the given
Boolean values is true, and false in all
other cases.bools - the Boolean values.NullPointerException - if bools is null or if
it contains a null reference.IllegalArgumentException - if bools is empty.public static Boolean not(Boolean bool)
Boolean.bool - the Boolean to negate.Boolean.NullPointerException - if bool is null.public static Boolean xor(Boolean... bools)
true if, and only if, only one of the given
Boolean values is true, and false in all
other cases.bools - the Boolean values.NullPointerException - if bools is null or if
it contains a null reference.IllegalArgumentException - if bools is empty.public static boolean isFalse(Boolean bool)
true if and only if the given Boolean object
is false.bool - the Boolean to test, may be null.Boolean is false.public static boolean isNotFalse(Boolean bool)
true if and only if the given Boolean object
is not false.bool - the Boolean to test, may be null.Boolean is not false.public static boolean isTrue(Boolean bool)
true if and only if the given Boolean object
is true.bool - the Boolean to test, may be null.Boolean is true.public static boolean isNotTrue(Boolean bool)
true if and only if the given Boolean object
is not true.bool - the Boolean to test, may be null.Boolean is not true.public static Boolean valueOf(String bool)
String into a Boolean. This method
returns true if the given String contains "true",
"yes", "1" or "on".bool - the String to parse.Boolean.NullPointerException - if bool is null.public static Boolean valueOf(int i)
int into a Boolean using the
convention that zero represents false and all other values
represent true.i - the int to convert.false if i == 0, true otherswise.public static Boolean valueOf(Integer i)
Integer into a Boolean using the
convention that zero represents false and all other values
represent true.i - the int to convert.false if i == 0, true otherswise.NullPointerException - if i is null.public static Boolean valueOf(boolean bool)
Boolean instance representing the given primitive
boolean value.bool - the boolean value to convert.Boolean instance representing the given value.public static Integer toInteger(boolean bool)
bool is true, 0 otherwise.bool - the boolean value to convert.bool is true, 0 otherwise.public static Integer toInteger(Boolean bool)
bool is true, 0 if false.bool - the Boolean instance to convert.bool is true, 0 if false.NullPointerException - if bool is null.public static String toString(boolean bool)
boolean's String representation.bool - the boolean value to convert.bool's String representation.Copyright © 2012–2015. All rights reserved.