Search in sources :

Example 1 with If

use of uk.gov.gchq.koryphe.impl.predicate.If in project gaffer-doc by gchq.

the class IfExample method applyPredicatesToInput.

public void applyPredicatesToInput() {
    // ---------------------------------------------------------
    final If<Comparable> predicate = new If<>(new IsA(Integer.class), new IsMoreThan(3), new Not<>(new IsA(String.class)));
    // ---------------------------------------------------------
    runExample(predicate, "This example tests first whether the input is an Integer. " + "If so, it is then tested to see if the value is greater than 3. " + "Otherwise, since it is not an Integer, we then test to see if it is NOT a String.", 2, 3, 5, "test", new HashMap<>(), new ArrayList<>());
}
Also used : IsA(uk.gov.gchq.koryphe.impl.predicate.IsA) IsMoreThan(uk.gov.gchq.koryphe.impl.predicate.IsMoreThan) If(uk.gov.gchq.koryphe.impl.predicate.If)

Aggregations

If (uk.gov.gchq.koryphe.impl.predicate.If)1 IsA (uk.gov.gchq.koryphe.impl.predicate.IsA)1 IsMoreThan (uk.gov.gchq.koryphe.impl.predicate.IsMoreThan)1