Java Utililty Methods Boolean From

List of utility methods to do Boolean From

Description

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

Method

BooleantoBoolean(Object o)
to Boolean
if (o == null) {
    return null;
} else if (o instanceof Boolean) {
    return (Boolean) o;
} else if (o instanceof Number) {
    int num = ((Number) o).intValue();
    return Boolean.valueOf(num != 0);
} else if (o instanceof String) {
...
BooleantoBoolean(Object o)
to Boolean
Boolean toReturn;
assertNotNull(o, "Input object cannot be null");
if (o instanceof Boolean) {
    toReturn = (Boolean) o;
} else {
    toReturn = new Boolean(toString(o));
return toReturn;
...
BooleantoBoolean(Object o)
to Boolean
Boolean b;
if (o instanceof Boolean) {
    b = (Boolean) o;
} else {
    String s = o.toString();
    if (s.equalsIgnoreCase("true")) {
        b = Boolean.TRUE;
    } else if (s.equalsIgnoreCase("false")) {
...
booleantoBoolean(Object obj)
to Boolean
return toBoolean(obj, false);
BooleantoBoolean(Object obj)
to Boolean
if (obj == null) {
    throw new IllegalArgumentException("obj is null");
if (obj instanceof Boolean) {
    return (Boolean) obj;
if (obj instanceof String) {
    String str = (String) obj;
...
BooleantoBoolean(Object obj)
to Boolean
if (obj == null) {
    return (Boolean) obj;
} else if (obj instanceof Boolean) {
    return (Boolean) obj;
} else if (obj instanceof Number) {
    final int num = ((Number) obj).intValue();
    if (num == 1) {
        return Boolean.TRUE;
...
booleantoBoolean(Object obj)
Convert object returned from server to boolean.
return (toLong(obj) != 0) ? true : false;
BooleantoBoolean(Object obj)
to Boolean
if (obj instanceof String)
    return Boolean.parseBoolean((String) obj);
return (Boolean) obj;
booleantoBoolean(Object obj)
to Boolean
return Boolean.valueOf(toString(obj).trim()).booleanValue();
booleantoBoolean(Object obj)
Get the boolean value of this object, only if the object is an instance of Boolean
return (obj instanceof Boolean) ? ((Boolean) obj).booleanValue() : false;