R - The type of reference used by tuples.public class Filter<R> extends Processor<R,ConsumerFunctionContext<R,FilterFunction>>
Filter is a Processor that tests input
Tuples against FilterFunctions. The functions are executed in
order and the overall filter result for a given tuple is a logical AND of each filter function result. Tuples only
pass the filter if all functions return a positive (true) result, and they fail as soon as any
function returns a negative (false) result.
If performance is a concern then simple, faster filters or those with a higher probability of failure should be configured to run first.
| Modifier and Type | Class and Description |
|---|---|
static class |
Filter.Builder<R>
Implementation of the Builder pattern for
Filter. |
| Constructor and Description |
|---|
Filter()
Default constructor - used for serialisation.
|
Filter(ConsumerFunctionContext<R,FilterFunction>... functions)
Create a
Filter that executes the given FunctionContexts. |
Filter(List<ConsumerFunctionContext<R,FilterFunction>> functions)
Create a
Filter that executes the given FunctionContexts. |
| Modifier and Type | Method and Description |
|---|---|
Filter<R> |
clone()
Create a deep copy of this
Filter. |
boolean |
filter(Tuple<R> tuple)
Test an input
Tuple against FilterFunctions, performing a
logical AND. |
addFunction, addFunctions, equals, getFunctions, hashCode, toStringpublic Filter()
public Filter(List<ConsumerFunctionContext<R,FilterFunction>> functions)
Filter that executes the given FunctionContexts.functions - FunctionContexts to execute.@SafeVarargs public Filter(ConsumerFunctionContext<R,FilterFunction>... functions)
Filter that executes the given FunctionContexts.functions - FunctionContexts to execute.public Filter<R> clone()
Filter.clone in class Processor<R,ConsumerFunctionContext<R,FilterFunction>>Filter.public boolean filter(Tuple<R> tuple)
Tuple against FilterFunctions, performing a
logical AND.tuple - Tuple to be filtered.Copyright © 2017. All rights reserved.