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 s)
to Boolean
if (s == null) {
    return (null);
return (new Boolean(s.toString()));
BooleantoBoolean(Object v)
to Boolean
if (null == v)
    return null;
if (v instanceof Boolean)
    return (Boolean) v;
return Boolean.parseBoolean(v.toString());
booleantoBoolean(Object val)
to Boolean
return toBoolean(val, false);
booleantoBoolean(Object val, boolean defValue)
to Boolean
if (val != null) {
    String value = String.valueOf(val);
    try {
        return Boolean.valueOf(value) || toInt(val, 0) == 1;
    } catch (Exception e) {
return defValue;
...
BooleantoBoolean(Object value)
to Boolean
if (value instanceof Boolean) {
    return (Boolean) value;
if (value instanceof String) {
    return "true".equalsIgnoreCase(value.toString()) ? Boolean.TRUE : Boolean.FALSE;
if (value instanceof Integer) {
    return (Integer) value > 0 ? Boolean.TRUE : Boolean.FALSE;
...
booleantoBoolean(Object value)
to Boolean
if (value instanceof Boolean)
    return ((Boolean) value).booleanValue();
else if (value == null)
    return false;
else
    return Boolean.parseBoolean(value.toString());
booleantoBoolean(Object value)
Converts the specified object into a boolean.
if (value instanceof Boolean) {
    return ((Boolean) value).booleanValue();
if (value instanceof Number) {
    return ((Number) value).intValue() != 0;
} else {
    String s = String.valueOf(value);
    if (s.length() == 0) {
...
booleantoBoolean(Object value)
to Boolean
if (null == value) {
    return false;
} else if (Boolean.class.isInstance(value)) {
    Boolean b = (Boolean) value;
    return b.booleanValue();
} else {
    String s = value.toString();
    return !"false".equals(s) && !"0".equals(s);
...
BooleantoBoolean(Object value)
Convert an Object to a Boolean.
if (value == null)
    return false;
if (value instanceof Boolean)
    return (Boolean) value;
if ("TRUE".equalsIgnoreCase(value.toString()))
    return Boolean.TRUE;
if ("".equals(value.toString()))
    return false;
...
BooleantoBoolean(Object value)
Tries to convert the given object value to Boolean .
if (value instanceof Boolean) {
    return (Boolean) value;
if (value instanceof String) {
    return Boolean.parseBoolean((String) value);
if (value instanceof Number) {
    return ((Number) value).longValue() > 0;
...