Package org.apache.camel.builder
Class PredicateClause<T>
- java.lang.Object
-
- org.apache.camel.builder.PredicateClause<T>
-
- All Implemented Interfaces:
org.apache.camel.Predicate
public class PredicateClause<T> extends Object implements org.apache.camel.Predicate
-
-
Constructor Summary
Constructors Constructor Description PredicateClause(T parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <B> T
body(Class<B> type, BiPredicate<B,Map<String,Object>> predicate)
Define aPredicate
which targets the typed Exchange In Body and its Headers.<B> T
body(Class<B> type, Predicate<B> predicate)
Define aPredicate
which targets the typed Exchange In Body.T
body(BiPredicate<Object,Map<String,Object>> predicate)
Define aPredicate
which targets the Exchange In Body and its Headers.T
body(Predicate<Object> predicate)
Define aPredicate
which targets the Exchange In Body.T
exchange(Predicate<org.apache.camel.Exchange> predicate)
Define aPredicate
which targets the Exchange.boolean
matches(org.apache.camel.Exchange exchange)
T
message(Predicate<org.apache.camel.Message> predicate)
Define aPredicate
which targets the Exchange In Message.
-
-
-
Constructor Detail
-
PredicateClause
public PredicateClause(T parent)
-
-
Method Detail
-
matches
public boolean matches(org.apache.camel.Exchange exchange)
- Specified by:
matches
in interfaceorg.apache.camel.Predicate
-
exchange
public T exchange(Predicate<org.apache.camel.Exchange> predicate)
Define aPredicate
which targets the Exchange.
-
message
public T message(Predicate<org.apache.camel.Message> predicate)
Define aPredicate
which targets the Exchange In Message.from("direct:aggregate") .choice() .when() .message(m -> m.getBody() != null) .log("Received ${body}") .endChoice()
-
body
public T body(Predicate<Object> predicate)
Define aPredicate
which targets the Exchange In Body.from("direct:aggregate") .choice() .when() .body(b -> b != null) .log("Received ${body}") .endChoice()
-
body
public <B> T body(Class<B> type, Predicate<B> predicate)
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
public T body(BiPredicate<Object,Map<String,Object>> predicate)
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
public <B> T body(Class<B> type, BiPredicate<B,Map<String,Object>> predicate)
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()
-
-