Package org.apache.camel.builder
Class AggregationStrategyClause<T>
java.lang.Object
org.apache.camel.builder.AggregationStrategyClause<T>
- All Implemented Interfaces:
org.apache.camel.AggregationStrategy
- Direct Known Subclasses:
EnrichClause
public class AggregationStrategyClause<T>
extends Object
implements org.apache.camel.AggregationStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Exchangeaggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) org.apache.camel.Exchangeaggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange, org.apache.camel.Exchange inputExchange) <B> Tbody(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.body(BiFunction<Object, Object, Object> function) Define an aggregation strategy which targets Exchanges In Body.exchange(BiFunction<org.apache.camel.Exchange, org.apache.camel.Exchange, org.apache.camel.Exchange> function) Define an aggregation strategy which targets the exchnage.message(BiFunction<org.apache.camel.Message, org.apache.camel.Message, org.apache.camel.Message> function) Define an aggregation strategy which targets Exchanges 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.AggregationStrategy
canPreComplete, onCompletion, onCompletion, onOptimisticLockFailure, preComplete, timeout
-
Constructor Details
-
AggregationStrategyClause
-
-
Method Details
-
aggregate
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange) - Specified by:
aggregatein interfaceorg.apache.camel.AggregationStrategy
-
aggregate
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange, org.apache.camel.Exchange inputExchange) - Specified by:
aggregatein interfaceorg.apache.camel.AggregationStrategy
-
exchange
public T exchange(BiFunction<org.apache.camel.Exchange, org.apache.camel.Exchange, org.apache.camel.Exchange> function) Define an aggregation strategy which targets the exchnage. -
message
public 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.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; }); -
body
Define an aggregation strategy which targets Exchanges In Body.from("direct:aggregate") .aggregate() .body((old, new) -> { if (old == null) { return new; } return old.toString() + new.toString(); }); -
body
Define an aggregation strategy which targets Exchanges In Body.from("direct:aggregate") .aggregate() .body(String.class, (old, new) -> { if (old == null) { return new; } return old + new; }); -
body
Define an aggregation strategy which targets Exchanges In Body.
-