Package org.apache.camel
Interface Predicate
-
- All Known Subinterfaces:
BinaryPredicate
public interface Predicate
Evaluates a binary predicate on the message exchange. A predicate should be thread-safe and be able to evaluate concurrently by different threads with different exchanges. Any initialization logic should be done by theinit(CamelContext)
method which allows to prepare the predicate such as wiring in resources, pre-parsing and what else.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
init(CamelContext context)
Initialize the predicate with the given camel contextdefault void
initPredicate(CamelContext context)
Initialize as a predicate with the given camel contextboolean
matches(Exchange exchange)
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
-
-
-
Method Detail
-
matches
boolean matches(Exchange exchange)
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate- Parameters:
exchange
- the message exchange- Returns:
- true if the predicate matches
-
init
default void init(CamelContext context)
Initialize the predicate with the given camel context- Parameters:
context
- the camel context
-
initPredicate
default void initPredicate(CamelContext context)
Initialize as a predicate with the given camel context- Parameters:
context
- the camel context
-
-