Or
See javadoc - uk.gov.gchq.koryphe.impl.binaryoperator.Or
Available since Koryphe version 1.0.0
Applies the logical OR operation to 2 booleans
Examples
Or with booleans
Java
JSON
Full JSON
final Or or = new Or();
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
Input type:
java.lang.Boolean
Example inputs:
Input Type | Inputs | Result Type | Result |
---|---|---|---|
java.lang.Boolean | true and true | java.lang.Boolean | true |
java.lang.Boolean | true and false | java.lang.Boolean | true |
java.lang.Boolean | false and false | java.lang.Boolean | false |
Or with nulls
Java
JSON
Full JSON
final Or or = new Or();
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
Input type:
java.lang.Boolean
Example inputs:
Input Type | Inputs | Result Type | Result |
---|---|---|---|
java.lang.Boolean | false and null | java.lang.Boolean | false |
java.lang.Boolean | true and null | java.lang.Boolean | true |
null and null | null |
Or with non boolean values
Java
JSON
Full JSON
final Or or = new Or();
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
{
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
Input type:
java.lang.Boolean
Example inputs:
Input Type | Inputs | Result Type | Result |
---|---|---|---|
java.lang.String | test and 3 | ClassCastException: java.lang.String cannot be cast to java.lang.Boolean | |
java.lang.Integer | 0 and 0 | ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean | |
java.lang.Integer | 1 and 0 | ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean |