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 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