List of utility methods to do Boolean Value From
boolean | booleanValue(Boolean b, boolean def) boolean Value return (b != null) ? b.booleanValue() : def;
|
boolean | booleanValue(Boolean value) Return the boolean value. if (value == null) return false; else return value.booleanValue(); |
boolean | booleanValue(final Boolean booleanValue) Get the boolean value of the Boolean .
return booleanValue == null ? false : booleanValue.booleanValue();
|
boolean | booleanValue(Object arg) boolean Value if (arg instanceof Boolean) return ((Boolean) arg).booleanValue(); else return Boolean.parseBoolean(arg.toString()); |
boolean | booleanValue(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; ... |
boolean | booleanValue(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)) { ... |
boolean | booleanValue(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; |
boolean | booleanValue(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()); |
boolean | booleanValue(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; |
boolean | booleanValue(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); |