List of utility methods to do Boolean From
boolean[] | toBooleans(byte[] bytes) to Booleans int size = toInt(bytes, 0); boolean[] result = new boolean[size]; for (int i = 0; i < size; i++) { result[i] = toBoolean(bytes, i + SIZEOF_INT); return result; |
boolean[] | toBooleans(byte[] value, int offset, int num) to Booleans boolean[] values = new boolean[num]; int idx = 0; for (int i = offset; i < num + offset; i++) { values[idx++] = getBoolean(value[i]); return values; |
String | toBooleanString(long value) Returns the boolean string for the value. if (value == 0x01L) { return "True"; return "False"; |
boolean | toBooleanTrue(String str) Only str is "off", "false", "no" return false, otherwise all true return !"off".equalsIgnoreCase(str) && !"false".equalsIgnoreCase(str) && !"no".equalsIgnoreCase(str); |
boolean | toBooleanValue(final Object o) to Boolean Value if (o instanceof Boolean) return ((Boolean) o).booleanValue(); return false; |
boolean | toBooleanValue(Object val) Returns true or false based on a "soft" object if (val == null) { return false; if (val instanceof Boolean) { return ((Boolean) val).booleanValue(); if (val instanceof String) { String sl = ((String) val).toLowerCase(); ... |
String | toBoolStr(boolean b) to Bool Str return String.valueOf(b);
|
String | toBoolString(Boolean b) Formats the specified boolean as string if (b == null || b == Boolean.FALSE) { return ZERO_STRING; return "1"; |