List of utility methods to do Boolean From
boolean | toBoolean(byte[] bytes, int offset) to Boolean if (offset >= bytes.length) { throw new RuntimeException("Cannot decode boolean from the buffer"); return bytes[offset] != (byte) 0; |
boolean | toBoolean(byte[] data, int offset) to Boolean return (data[offset] == 1);
|
boolean | toBoolean(byte[] value) byte[] -> boolean return (value == null || value.length == 0) ? false : value[0] != 0x00;
|
Boolean | toBoolean(char c) convert 'y', or 'n' to boolean switch (c) { case 'y': return true; case 'n': return false; default: return null; |
boolean | toBoolean(double value) to Boolean return value != 0.0;
|
boolean | toBoolean(final Boolean bool) Method to convert Boolean object to boolean primitive return bool != null && bool.booleanValue();
|
boolean | toBoolean(final Boolean bool) Converts a Boolean to a boolean handling null by returning false . return bool != null && bool.booleanValue();
|
boolean | toBoolean(final byte[] b) Reverses #toBytes(boolean) if (b.length != 1) { throw new IllegalArgumentException("Array has wrong size: " + b.length); return b[0] != (byte) 0; |
boolean | toBoolean(final Object obj, final boolean defaultValue) to Boolean boolean result = defaultValue; if (obj != null) { if (obj instanceof Boolean) { result = ((Boolean) obj).booleanValue(); } else { result = Boolean.valueOf(String.valueOf(obj)); return result; |
boolean | toBoolean(final Object value) To boolean. boolean result = false; if (value != null) { if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")) { result = true; } else { result = false; } else { ... |