And

See javadoc - uk.gov.gchq.koryphe.impl.binaryoperator.And

Available since Koryphe version 1.0.0

Applies the logical AND operation to 2 booleans

Examples

And with booleans

Java
JSON
Full JSON
final And and = new And();
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}

Input type:

java.lang.Boolean

Example inputs:

Input TypeInputsResult TypeResult
java.lang.Booleantrue and truejava.lang.Booleantrue
java.lang.Booleantrue and falsejava.lang.Booleanfalse
java.lang.Booleanfalse and falsejava.lang.Booleanfalse

And with nulls

Java
JSON
Full JSON
final And and = new And();
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}

Input type:

java.lang.Boolean

Example inputs:

Input TypeInputsResult TypeResult
java.lang.Booleanfalse and nulljava.lang.Booleanfalse
java.lang.Booleantrue and nulljava.lang.Booleantrue
null and nullnull

And with non boolean values

Java
JSON
Full JSON
final And and = new And();
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}
{
  "class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}

Input type:

java.lang.Boolean

Example inputs:

Input TypeInputsResult TypeResult
java.lang.Stringtest and 3ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
java.lang.Integer0 and 0ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
java.lang.Integer1 and 0ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean

results matching ""

    No results matching ""