List of utility methods to do Boolean Value From
boolean | booleanValue(String s) boolean Value boolean rv = false; if (s != null && s.equalsIgnoreCase("true")) rv = true; return rv; |
boolean | booleanValue(String s) Returns the boolean corresponding to a given string.
return Boolean.valueOf(s).booleanValue();
|
boolean | booleanValue(String stringValue) boolean Value return stringValue != null && (stringValue.equals("1") || stringValue.equalsIgnoreCase("t") || stringValue.equalsIgnoreCase("true") || stringValue.equalsIgnoreCase("y") || stringValue.equalsIgnoreCase("yes")); |
boolean | booleanValue(String tfString) boolean Value String trimmed = tfString.trim().toLowerCase(); return trimmed.equals("true") || trimmed.equals("t"); |
boolean | booleanValue(String tfString) boolean Value String trimmed = tfString.trim().toLowerCase(); return trimmed.equals("true") || trimmed.equals("t"); |
boolean | booleanValue(String tfString) boolean Value String trimmed = tfString.trim().toLowerCase(); return trimmed.equals("true") || trimmed.equals("t"); |
Boolean | booleanValueOf(boolean b) boolean Value Of return (b ? Boolean.TRUE : Boolean.FALSE);
|
boolean | booleanValueOf(Object obj) boolean Value Of if (obj instanceof Boolean) { return ((Boolean) obj).booleanValue(); } else if (obj instanceof String) { return Boolean.valueOf((String) obj).booleanValue(); } else { throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected."); |
boolean | booleanValueWithYN(String string) This method is to convert a boolean value with a y or n string. if (string == null) { return false; return string.equalsIgnoreCase("YES") || string.equalsIgnoreCase("y"); |
boolean | convertBoolean(Boolean convertedValue, boolean defaultValue) convert Boolean return (convertedValue != null) ? convertedValue : defaultValue;
|