public class AggregationStrategyClause<T> extends Object implements org.apache.camel.AggregationStrategy
Constructor and Description |
---|
AggregationStrategyClause(T parent) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Exchange |
aggregate(org.apache.camel.Exchange oldExchange,
org.apache.camel.Exchange newExchange) |
org.apache.camel.Exchange |
aggregate(org.apache.camel.Exchange oldExchange,
org.apache.camel.Exchange newExchange,
org.apache.camel.Exchange inputExchange) |
T |
body(BiFunction<Object,Object,Object> function)
Define an aggregation strategy which targets Exchanges In Body.
|
<B> T |
body(Class<B> type,
BiFunction<B,B,Object> function)
Define an aggregation strategy which targets Exchanges In Body.
|
<O,N> T |
body(Class<O> oldType,
Class<N> newType,
BiFunction<O,N,Object> function)
Define an aggregation strategy which targets Exchanges In Body.
|
T |
exchange(BiFunction<org.apache.camel.Exchange,org.apache.camel.Exchange,org.apache.camel.Exchange> function)
Define an aggregation strategy which targets the exchnage.
|
T |
message(BiFunction<org.apache.camel.Message,org.apache.camel.Message,org.apache.camel.Message> function)
Define an aggregation strategy which targets Exchanges In Message.
|
public AggregationStrategyClause(T parent)
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange)
aggregate
in interface org.apache.camel.AggregationStrategy
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange, org.apache.camel.Exchange inputExchange)
aggregate
in interface org.apache.camel.AggregationStrategy
public T exchange(BiFunction<org.apache.camel.Exchange,org.apache.camel.Exchange,org.apache.camel.Exchange> function)
public T message(BiFunction<org.apache.camel.Message,org.apache.camel.Message,org.apache.camel.Message> function)
from("direct:aggregate") .aggregate() .message((old, new) -> { if (old == null) { return new; } String oldBody = old.getBody(String.class); String newBody = new.getBody(String.class); old.setBody(oldBody + "+" + newBody); return old; });
public T body(BiFunction<Object,Object,Object> function)
from("direct:aggregate") .aggregate() .body((old, new) -> { if (old == null) { return new; } return old.toString() + new.toString(); });
public <B> T body(Class<B> type, BiFunction<B,B,Object> function)
from("direct:aggregate") .aggregate() .body(String.class, (old, new) -> { if (old == null) { return new; } return old + new; });
public <O,N> T body(Class<O> oldType, Class<N> newType, BiFunction<O,N,Object> function)
Apache Camel