Search in sources :

Example 1 with And

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

the class AndExample method isLessThan3AndIsMoreThan0.

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

Example 2 with And

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

the class AndExample method property1IsLessThan2AndProperty2IsMoreThan2.

public void property1IsLessThan2AndProperty2IsMoreThan2() {
    // ---------------------------------------------------------
    final And function = new And(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) ConsumerFunctionContext(uk.gov.gchq.gaffer.function.context.ConsumerFunctionContext) IsLessThan(uk.gov.gchq.gaffer.function.filter.IsLessThan) And(uk.gov.gchq.gaffer.function.filter.And) 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 And (uk.gov.gchq.gaffer.function.filter.And)2 IsLessThan (uk.gov.gchq.gaffer.function.filter.IsLessThan)2 IsMoreThan (uk.gov.gchq.gaffer.function.filter.IsMoreThan)2