public class PredicateClause<T> extends Object implements 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<Exchange> predicate)
Define a
Predicate which targets the Exchange. |
boolean |
matches(Exchange exchange)
Evaluates the predicate on the message exchange and returns true if this
exchange matches the predicate
|
T |
message(Predicate<Message> predicate)
Define a
Predicate which targets the Exchange In Message. |
public PredicateClause(T parent)
public boolean matches(Exchange exchange)
Predicate
public T exchange(Predicate<Exchange> predicate)
Predicate
which targets the Exchange.public T message(Predicate<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