List of utility methods to do Boolean From
Boolean | toBoolean(Object s) to Boolean if (s == null) { return (null); return (new Boolean(s.toString())); |
Boolean | toBoolean(Object v) to Boolean if (null == v) return null; if (v instanceof Boolean) return (Boolean) v; return Boolean.parseBoolean(v.toString()); |
boolean | toBoolean(Object val) to Boolean return toBoolean(val, false); |
boolean | toBoolean(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; ... |
Boolean | toBoolean(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; ... |
boolean | toBoolean(Object value) to Boolean if (value instanceof Boolean) return ((Boolean) value).booleanValue(); else if (value == null) return false; else return Boolean.parseBoolean(value.toString()); |
boolean | toBoolean(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) { ... |
boolean | toBoolean(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); ... |
Boolean | toBoolean(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; ... |
Boolean | toBoolean(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; ... |