Class RichOrCondition<T>
- java.lang.Object
-
- org.apache.flink.cep.pattern.conditions.IterativeCondition<T>
-
- org.apache.flink.cep.pattern.conditions.RichIterativeCondition<T>
-
- org.apache.flink.cep.pattern.conditions.RichCompositeIterativeCondition<T>
-
- org.apache.flink.cep.pattern.conditions.RichOrCondition<T>
-
- Type Parameters:
T
- Type of the element to filter
- All Implemented Interfaces:
Serializable
,Function
,RichFunction
@Internal public class RichOrCondition<T> extends RichCompositeIterativeCondition<T>
Acondition
which combines two conditions with a logicalOR
and returnstrue
if at least one istrue
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.cep.pattern.conditions.IterativeCondition
IterativeCondition.Context<T>
-
-
Constructor Summary
Constructors Constructor Description RichOrCondition(IterativeCondition<T> left, IterativeCondition<T> right)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
filter(T value, IterativeCondition.Context<T> ctx)
The filter function that evaluates the predicate.IterativeCondition<T>
getLeft()
IterativeCondition<T>
getRight()
-
Methods inherited from class org.apache.flink.cep.pattern.conditions.RichCompositeIterativeCondition
close, getNestedConditions, open, setRuntimeContext
-
Methods inherited from class org.apache.flink.cep.pattern.conditions.RichIterativeCondition
getIterationRuntimeContext, getRuntimeContext
-
-
-
-
Constructor Detail
-
RichOrCondition
public RichOrCondition(IterativeCondition<T> left, IterativeCondition<T> right)
-
-
Method Detail
-
filter
public boolean filter(T value, IterativeCondition.Context<T> ctx) throws Exception
Description copied from class:IterativeCondition
The filter function that evaluates the predicate.IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.
- Specified by:
filter
in classIterativeCondition<T>
- Parameters:
value
- The value to be tested.ctx
- TheIterativeCondition.Context
used for the evaluation of the function and provides access to the already accepted events in the pattern (seeIterativeCondition.Context.getEventsForPattern(String)
).- Returns:
true
for values that should be retained,false
for values to be filtered out.- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
getLeft
public IterativeCondition<T> getLeft()
- Returns:
- One of the
conditions
combined in this condition.
-
getRight
public IterativeCondition<T> getRight()
- Returns:
- One of the
conditions
combined in this condition.
-
-