Java Utililty Methods Boolean Value From

List of utility methods to do Boolean Value From

Description

The list of methods to do Boolean Value From are organized into topic(s).

Method

booleanbooleanValue(Boolean b, boolean def)
boolean Value
return (b != null) ? b.booleanValue() : def;
booleanbooleanValue(Boolean value)
Return the boolean value.
if (value == null)
    return false;
else
    return value.booleanValue();
booleanbooleanValue(final Boolean booleanValue)
Get the boolean value of the Boolean.
return booleanValue == null ? false : booleanValue.booleanValue();
booleanbooleanValue(Object arg)
boolean Value
if (arg instanceof Boolean)
    return ((Boolean) arg).booleanValue();
else
    return Boolean.parseBoolean(arg.toString());
booleanbooleanValue(Object associationValue)
boolean Value
boolean associationEvaluation = true;
if (associationValue != null) {
    if (associationValue instanceof Number) {
        if (((Number) associationValue).intValue() == 0) {
            associationEvaluation = false;
    } else if (associationValue instanceof String) {
        String associationValueString = (String) associationValue;
...
booleanbooleanValue(Object obj, boolean defaultValue)
boolean Value
if (obj != null) {
    if (obj instanceof Boolean) {
        return ((Boolean) obj).booleanValue();
    String stringValue = obj.toString().toLowerCase();
    if (isTrueString(stringValue)) {
        return true;
    } else if (isFalseString(stringValue)) {
...
booleanbooleanValue(Object object)
Converts the supplied object to boolean.
if (object instanceof Number) {
    double value = ((Number) object).doubleValue();
    final int negZero = -0;
    return value != 0 && value != negZero && !Double.isNaN(value);
if (object instanceof Boolean) {
    return ((Boolean) object).booleanValue();
if (object instanceof String) {
    return ((String) object).length() != 0;
return object != null;
booleanbooleanValue(Object value)
Convert an Object to a Boolean.
if (value == null)
    return false;
if (value instanceof Boolean)
    return ((Boolean) value).booleanValue();
if (value instanceof Number)
    return ((Number) value).intValue() != 0;
return "TRUE".equalsIgnoreCase(value.toString());
booleanbooleanValue(String s)
Convert a String value to 'boolean'.
boolean b = false;
if (s != null) {
    if (s.equalsIgnoreCase("yes")) {
        b = true;
    } else {
        b = Boolean.parseBoolean(s);
return b;
booleanbooleanValue(String s)
boolean Value
if (s.equals("true") || s.equals("1")) {
    return true;
} else if (s.equals("false") || s.equals("0")) {
    return false;
} else {
    throw new IllegalArgumentException("Not an XML boolean: " + s);