Java Utililty Methods Boolean From

List of utility methods to do Boolean From

Description

The list of methods to do Boolean From are organized into topic(s).

Method

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;
StringtoBooleanString(long value)
Returns the boolean string for the value.
if (value == 0x01L) {
    return "True";
return "False";
booleantoBooleanTrue(String str)
Only str is "off", "false", "no" return false, otherwise all true
return !"off".equalsIgnoreCase(str) && !"false".equalsIgnoreCase(str) && !"no".equalsIgnoreCase(str);
booleantoBooleanValue(final Object o)
to Boolean Value
if (o instanceof Boolean)
    return ((Boolean) o).booleanValue();
return false;
booleantoBooleanValue(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();
...
StringtoBoolStr(boolean b)
to Bool Str
return String.valueOf(b);
StringtoBoolString(Boolean b)
Formats the specified boolean as string
if (b == null || b == Boolean.FALSE) {
    return ZERO_STRING;
return "1";