Package org.apache.camel.builder
Class PredicateClause<T>
java.lang.Object
org.apache.camel.builder.PredicateClause<T>
- All Implemented Interfaces:
org.apache.camel.Predicate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<B> T
Define aPredicate
which targets the typed Exchange In Body and its Headers.<B> T
Define aPredicate
which targets the typed Exchange In Body.Define aPredicate
which targets the Exchange In Body and its Headers.Define aPredicate
which targets the Exchange In Body.Define aPredicate
which targets the Exchange.boolean
matches
(org.apache.camel.Exchange exchange) Define aPredicate
which targets the Exchange In Message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.Predicate
init, initPredicate
-
Constructor Details
-
PredicateClause
-
-
Method Details
-
matches
public boolean matches(org.apache.camel.Exchange exchange) - Specified by:
matches
in interfaceorg.apache.camel.Predicate
-
exchange
Define aPredicate
which targets the Exchange. -
message
Define aPredicate
which targets the Exchange In Message.from("direct:aggregate") .choice() .when() .message(m -> m.getBody() != null) .log("Received ${body}") .endChoice()
-
body
Define aPredicate
which targets the Exchange In Body.from("direct:aggregate") .choice() .when() .body(b -> b != null) .log("Received ${body}") .endChoice()
-
body
Define aPredicate
which targets the typed Exchange In Body.from("direct:aggregate") .choice() .when() .body(Long.class, b -> (b & 1) == 0) .log("Received even number ${body}") .endChoice()
-
body
Define aPredicate
which targets the Exchange In Body and its Headers.from("direct:aggregate") .choice() .when() .body((b, h) -> b != null || h.containsKy("ToProcess")) .log("Received ${body}") .endChoice()
-
body
Define aPredicate
which targets the typed Exchange In Body and its Headers.from("direct:aggregate") .choice() .when() .body(String.class, (b, h) -> b != null && !b.isEmpty() || h.containsKy("ToProcess")) .log("Received ${body}") .endChoice()
-