List of utility methods to do Boolean Parse
Boolean | tryParseBool(Object obj, Boolean defaultVal) try Parse Bool if (obj == null) return defaultVal; if (obj instanceof Boolean) return (Boolean) obj; try { String val = obj.toString(); return Boolean.parseBoolean(val); } catch (Exception e) { ... |
boolean | tryParseBool(String value) try Parse Bool try { Boolean.parseBoolean(value); return true; } catch (Exception e) { return false; |
boolean | tryParseBoolean(String value) Returns whether or not the String can be parsed as an Boolean return value.equals("true") || value.equals("false"); |
Boolean | tryParseBoolean(String value) try Parse Boolean if (value == null) { return null; if (value.equalsIgnoreCase("true")) { return true; } else if (value.equalsIgnoreCase("false")) { return false; return null; |