public class PredicateClause<T> extends Object implements org.apache.camel.Predicate
Constructor and Description |
---|
PredicateClause(T parent) |
Modifier and Type | Method and Description |
---|---|
T |
body(BiPredicate<Object,Map<String,Object>> predicate)
Define a
Predicate which targets the Exchange In
Body and its Headers. |
<B> T |
body(Class<B> type,
BiPredicate<B,Map<String,Object>> predicate)
Define a
Predicate which targets the typed
Exchange In Body and its Headers. |
<B> T |
body(Class<B> type,
Predicate<B> predicate)
Define a
Predicate which targets the typed
Exchange In Body. |
T |
body(Predicate<Object> predicate)
Define a
Predicate which targets the Exchange In
Body. |
T |
exchange(Predicate<org.apache.camel.Exchange> predicate)
Define a
Predicate which targets the Exchange. |
boolean |
matches(org.apache.camel.Exchange exchange) |
T |
message(Predicate<org.apache.camel.Message> predicate)
Define a
Predicate which targets the Exchange In
Message. |
public PredicateClause(T parent)
public boolean matches(org.apache.camel.Exchange exchange)
matches
in interface org.apache.camel.Predicate
public T exchange(Predicate<org.apache.camel.Exchange> predicate)
Predicate
which targets the Exchange.public T message(Predicate<org.apache.camel.Message> predicate)
Predicate
which targets the Exchange In
Message. from("direct:aggregate") .choice() .when() .message(m -> m.getBody() != null) .log("Received ${body}") .endChoice()
public T body(Predicate<Object> predicate)
Predicate
which targets the Exchange In
Body. from("direct:aggregate") .choice() .when() .body(b -> b != null) .log("Received ${body}") .endChoice()
public <B> T body(Class<B> type, Predicate<B> predicate)
Predicate
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()
public T body(BiPredicate<Object,Map<String,Object>> predicate)
Predicate
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()
public <B> T body(Class<B> type, BiPredicate<B,Map<String,Object>> predicate)
Predicate
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()
Apache Camel