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 the
init(CamelContext)
method which allows to prepare the
predicate such as wiring in resources, pre-parsing and what else.-
Method Summary
Modifier and TypeMethodDescriptiondefault 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
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
-
Method Details
-
matches
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
Initialize the predicate with the given camel context- Parameters:
context
- the camel context
-
initPredicate
Initialize as a predicate with the given camel context- Parameters:
context
- the camel context
-