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
Constructors -
Method Summary
Modifier and TypeMethodDescription<B> TDefine aPredicatewhich targets the typed Exchange In Body and its Headers.<B> TDefine aPredicatewhich targets the typed Exchange In Body.Define aPredicatewhich targets the Exchange In Body and its Headers.Define aPredicatewhich targets the Exchange In Body.Define aPredicatewhich targets the Exchange.booleanmatches(org.apache.camel.Exchange exchange) Define aPredicatewhich targets the Exchange In Message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
matchesin interfaceorg.apache.camel.Predicate
-
exchange
Define aPredicatewhich targets the Exchange. -
message
Define aPredicatewhich targets the Exchange In Message.from("direct:aggregate") .choice() .when() .message(m -> m.getBody() != null) .log("Received ${body}") .endChoice() -
body
Define aPredicatewhich targets the Exchange In Body.from("direct:aggregate") .choice() .when() .body(b -> b != null) .log("Received ${body}") .endChoice() -
body
Define aPredicatewhich 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 aPredicatewhich 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 aPredicatewhich 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()
-