Example usage for Java org.apache.commons.lang BooleanUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | isFalse(Boolean bool) Checks if a BooleanUtils.isFalse(Boolean.TRUE) = false BooleanUtils.isFalse(Boolean.FALSE) = true BooleanUtils.isFalse(null) = false |
boolean | isNotFalse(Boolean bool) Checks if a BooleanUtils.isNotFalse(Boolean.TRUE) = true BooleanUtils.isNotFalse(Boolean.FALSE) = false BooleanUtils.isNotFalse(null) = true |
boolean | isNotTrue(Boolean bool) Checks if a BooleanUtils.isNotTrue(Boolean.TRUE) = false BooleanUtils.isNotTrue(Boolean.FALSE) = true BooleanUtils.isNotTrue(null) = true |
boolean | isTrue(Boolean bool) Checks if a BooleanUtils.isTrue(Boolean.TRUE) = true BooleanUtils.isTrue(Boolean.FALSE) = false BooleanUtils.isTrue(null) = false |
Boolean | negate(Boolean bool) Negates the specified boolean. If BooleanUtils.negate(Boolean.TRUE) = Boolean.FALSE; BooleanUtils.negate(Boolean.FALSE) = Boolean.TRUE; BooleanUtils.negate(null) = null; |
boolean | toBoolean(Boolean bool) Converts a Boolean to a boolean handling BooleanUtils.toBoolean(Boolean.TRUE) = true BooleanUtils.toBoolean(Boolean.FALSE) = false BooleanUtils.toBoolean(null) = false |
boolean | toBoolean(int value) Converts an int to a boolean using the convention that BooleanUtils.toBoolean(0) = false BooleanUtils.toBoolean(1) = true BooleanUtils.toBoolean(2) = true |
boolean | toBoolean(String str) Converts a String to a boolean (optimised for performance).
|
boolean | toBoolean(int value, int trueValue, int falseValue) Converts an int to a boolean specifying the conversion values. BooleanUtils.toBoolean(0, 1, 0) = false BooleanUtils.toBoolean(1, 1, 0) = true BooleanUtils.toBoolean(2, 1, 2) = false BooleanUtils.toBoolean(2, 2, 0) = true |
boolean | toBoolean(Integer value, Integer trueValue, Integer falseValue) Converts an Integer to a boolean specifying the conversion values. BooleanUtils.toBoolean(new Integer(0), new Integer(1), new Integer(0)) = false BooleanUtils.toBoolean(new Integer(1), new Integer(1), new Integer(0)) = true BooleanUtils.toBoolean(new Integer(2), new Integer(1), new Integer(2)) = false BooleanUtils.toBoolean(new Integer(2), new Integer(2), new Integer(0)) = true BooleanUtils.toBoolean(null, null, new Integer(0)) = true |
boolean | toBoolean(String str, String trueString, String falseString) Converts a String to a Boolean throwing an exception if no match found. null is returned if there is no match. BooleanUtils.toBoolean("true", "true", "false") = true BooleanUtils.toBoolean("false", "true", "false") = false |
boolean | toBooleanDefaultIfNull(Boolean bool, boolean valueIfNull) Converts a Boolean to a boolean handling BooleanUtils.toBooleanDefaultIfNull(Boolean.TRUE, false) = true BooleanUtils.toBooleanDefaultIfNull(Boolean.FALSE, true) = false BooleanUtils.toBooleanDefaultIfNull(null, true) = true |
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 |
Boolean | toBooleanObject(int value) Converts an int to a Boolean using the convention that BooleanUtils.toBoolean(0) = Boolean.FALSE BooleanUtils.toBoolean(1) = Boolean.TRUE BooleanUtils.toBoolean(2) = Boolean.TRUE |
Boolean | toBooleanObject(Integer value) Converts an Integer to a Boolean using the convention that
BooleanUtils.toBoolean(new Integer(0)) = Boolean.FALSE BooleanUtils.toBoolean(new Integer(1)) = Boolean.TRUE BooleanUtils.toBoolean(new Integer(null)) = null |
Boolean | toBooleanObject(String str) Converts a String to a Boolean.
|
Boolean | toBooleanObject(int value, int trueValue, int falseValue, int nullValue) Converts an int to a Boolean specifying the conversion values. BooleanUtils.toBooleanObject(0, 0, 2, 3) = Boolean.TRUE BooleanUtils.toBooleanObject(2, 1, 2, 3) = Boolean.FALSE BooleanUtils.toBooleanObject(3, 1, 2, 3) = null |
Boolean | toBooleanObject(Integer value, Integer trueValue, Integer falseValue, Integer nullValue) Converts an Integer to a Boolean specifying the conversion values. BooleanUtils.toBooleanObject(new Integer(0), new Integer(0), new Integer(2), new Integer(3)) = Boolean.TRUE BooleanUtils.toBooleanObject(new Integer(2), new Integer(1), new Integer(2), new Integer(3)) = Boolean.FALSE BooleanUtils.toBooleanObject(new Integer(3), new Integer(1), new Integer(2), new Integer(3)) = null |
Boolean | toBooleanObject(String str, String trueString, String falseString, String nullString) Converts a String to a Boolean throwing an exception if no match. BooleanUtils.toBooleanObject("true", "true", "false", "null") = Boolean.TRUE BooleanUtils.toBooleanObject("false", "true", "false", "null") = Boolean.FALSE BooleanUtils.toBooleanObject("null", "true", "false", "null") = null |
int | toInteger(boolean bool) Converts a boolean to an int using the convention that BooleanUtils.toInteger(true) = 1 BooleanUtils.toInteger(false) = 0 |
int | toInteger(Boolean bool, int trueValue, int falseValue, int nullValue) Converts a Boolean to an int specifying the conversion values. BooleanUtils.toInteger(Boolean.TRUE, 1, 0, 2) = 1 BooleanUtils.toInteger(Boolean.FALSE, 1, 0, 2) = 0 BooleanUtils.toInteger(null, 1, 0, 2) = 2 |
Integer | toIntegerObject(boolean bool) Converts a boolean to an Integer using the convention that BooleanUtils.toIntegerObject(true) = new Integer(1) BooleanUtils.toIntegerObject(false) = new Integer(0) |
Integer | toIntegerObject(Boolean bool) Converts a Boolean to a Integer using the convention that
BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) |
String | toString(Boolean bool, String trueString, String falseString, String nullString) Converts a Boolean to a String returning one of the input Strings. BooleanUtils.toString(Boolean.TRUE, "true", "false", null) = "true" BooleanUtils.toString(Boolean.FALSE, "true", "false", null) = "false" BooleanUtils.toString(null, "true", "false", null) = null; |
String | toString(boolean bool, String trueString, String falseString) Converts a boolean to a String returning one of the input Strings. BooleanUtils.toString(true, "true", "false") = "true" BooleanUtils.toString(false, "true", "false") = "false" |
String | toStringTrueFalse(Boolean bool) Converts a Boolean to a String returning BooleanUtils.toStringTrueFalse(Boolean.TRUE) = "true" BooleanUtils.toStringTrueFalse(Boolean.FALSE) = "false" BooleanUtils.toStringTrueFalse(null) = null; |
String | toStringTrueFalse(boolean bool) Converts a boolean to a String returning BooleanUtils.toStringTrueFalse(true) = "true" BooleanUtils.toStringTrueFalse(false) = "false" |
String | toStringYesNo(Boolean bool) Converts a Boolean to a String returning BooleanUtils.toStringYesNo(Boolean.TRUE) = "yes" BooleanUtils.toStringYesNo(Boolean.FALSE) = "no" BooleanUtils.toStringYesNo(null) = null; |
String | toStringYesNo(boolean bool) Converts a boolean to a String returning BooleanUtils.toStringYesNo(true) = "yes" BooleanUtils.toStringYesNo(false) = "no" |
boolean | xor(boolean[] array) Performs an xor on a set of booleans. BooleanUtils.xor(new boolean[] { true, true }) = false BooleanUtils.xor(new boolean[] { false, false }) = false BooleanUtils.xor(new boolean[] { true, false }) = true |
Boolean | xor(Boolean[] array) Performs an xor on an array of Booleans. BooleanUtils.xor(new Boolean[] { Boolean.TRUE, Boolean.TRUE }) = Boolean.FALSE BooleanUtils.xor(new Boolean[] { Boolean.FALSE, Boolean.FALSE }) = Boolean.FALSE BooleanUtils.xor(new Boolean[] { Boolean.TRUE, Boolean.FALSE }) = Boolean.TRUE |