Java Utililty Methods Boolean And

List of utility methods to do Boolean And

Description

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

Method

booleanand(boolean a, boolean b)
and
return a && b;
booleanand(boolean b1, boolean b2)
Concatenate two booleans with the operation "AND"
return b1 && b2;
booleanand(boolean val1, boolean val2)
Returns (val1 && val2).
return val1 && val2;
booleanand(boolean... bools)
An and gate
boolean total = true;
for (boolean bool : bools)
    total = total && bool;
return total;
booleanand(boolean... bs)
and
boolean r = true;
for (boolean b : bs) {
    r = b && r;
return r;
Booleanand(Boolean... operands)
n-ary and that ignores null values.
Boolean result = null;
for (Boolean operand : operands) {
    if (operand == null) {
        continue;
    if (!operand) {
        return false;
    result = true;
return result;
BooleanandBoolOperand(Boolean o, Boolean a)
And 2 Boolean operands in the context of pruning match Operand one|Operand another | And result unknown | T | unknown unknown | F | F unknown | unknown | unknown T | T | T T | F | F T | unknown | unknown F | T | F F | F | F F | unknown | F
if (o == null) {
    if ((a == null) || a) {
        return null;
    } else {
        return a;
} else if (a == null) {
    return o ? null : Boolean.FALSE;
...