Search in sources :

Example 1 with Or

use of uk.gov.gchq.gaffer.function.filter.Or in project Gaffer by gchq.

the class OrExample method property1IsLessThan2OrProperty2IsMoreThan2.

public void property1IsLessThan2OrProperty2IsMoreThan2() {
    // ---------------------------------------------------------
    final Or function = new Or(Arrays.asList(new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
    0).execute(new IsLessThan(2)).build(), new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select second property
    1).execute(new IsMoreThan(2)).build()));
    // ---------------------------------------------------------
    runExample(function, new Object[] { 1, 3 }, new Object[] { 1, 1 }, new Object[] { 3, 3 }, new Object[] { 3, 1 }, new Object[] { 1L, 3L }, new Object[] { 1 });
}
Also used : FilterFunction(uk.gov.gchq.gaffer.function.FilterFunction) Or(uk.gov.gchq.gaffer.function.filter.Or) ConsumerFunctionContext(uk.gov.gchq.gaffer.function.context.ConsumerFunctionContext) IsLessThan(uk.gov.gchq.gaffer.function.filter.IsLessThan) IsMoreThan(uk.gov.gchq.gaffer.function.filter.IsMoreThan)

Example 2 with Or

use of uk.gov.gchq.gaffer.function.filter.Or in project Gaffer by gchq.

the class OrExample method isLessThan2OrIsMoreThan2.

public void isLessThan2OrIsMoreThan2() {
    // ---------------------------------------------------------
    final Or function = new Or(Arrays.asList(new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
    0).execute(new IsLessThan(2)).build(), new ConsumerFunctionContext.Builder<Integer, FilterFunction>().select(// select first property
    0).execute(new IsMoreThan(2)).build()));
    // ---------------------------------------------------------
    runExample(function, new Object[] { 1 }, new Object[] { 2 }, new Object[] { 3 }, new Object[] { 1L }, new Object[] { 3L });
}
Also used : FilterFunction(uk.gov.gchq.gaffer.function.FilterFunction) Or(uk.gov.gchq.gaffer.function.filter.Or) ConsumerFunctionContext(uk.gov.gchq.gaffer.function.context.ConsumerFunctionContext) IsLessThan(uk.gov.gchq.gaffer.function.filter.IsLessThan) IsMoreThan(uk.gov.gchq.gaffer.function.filter.IsMoreThan)

Aggregations

FilterFunction (uk.gov.gchq.gaffer.function.FilterFunction)2 ConsumerFunctionContext (uk.gov.gchq.gaffer.function.context.ConsumerFunctionContext)2 IsLessThan (uk.gov.gchq.gaffer.function.filter.IsLessThan)2 IsMoreThan (uk.gov.gchq.gaffer.function.filter.IsMoreThan)2 Or (uk.gov.gchq.gaffer.function.filter.Or)2