Package com.hazelcast.jet.aggregate
Class AggregateOperationBuilder<A>
java.lang.Object
com.hazelcast.jet.aggregate.AggregateOperationBuilder<A>
- Type Parameters:
A- the type of the accumulator
A builder object that can be used to construct the definition of an
aggregate operation in a step-by-step manner. Please refer to
AggregateOperation.withCreate() for more details.- Since:
- Jet 3.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe arity-1 variant of the aggregate operation builder.static classThe arity-2 variant of the aggregate operation builder.static classThe arity-3 variant of the aggregate operation builder.static classThe variable-arity variant of the aggregate operation builder. -
Method Summary
Modifier and TypeMethodDescriptionandAccumulate(BiConsumerEx<? super A, ? super T> accumulateFn) Registers theAggregateOperation1.accumulateFn()accumulate} primitive.andAccumulate(Tag<T> tag, BiConsumerEx<? super A, ? super T> accumulateFn) Registers theaccumulateprimitive for the stream tagged with the supplied tag.<T0> AggregateOperationBuilder.Arity1<T0,A, Void> andAccumulate0(BiConsumerEx<? super A, ? super T0> accumulateFn0) Registers theaccumulateprimitive for stream-0.varArity()Selects the variable-arity variant for this aggregate operation builder.
-
Method Details
-
andAccumulate
@Nonnull public <T> AggregateOperationBuilder.Arity1<T,A, andAccumulateVoid> (@Nonnull BiConsumerEx<? super A, ? super T> accumulateFn) Registers theAggregateOperation1.accumulateFn()accumulate} primitive. Also selects the fixed-arity variant of the aggregate operation.This method is synonymous with
andAccumulate0(), but makes more sense when defining a simple, arity-1 aggregate operation.- Type Parameters:
T- the expected type of input item- Parameters:
accumulateFn- theaccumulateprimitive, parameters are(accumulator, item). It must be stateless and cooperative.- Returns:
- a new builder object that captures the
T0type parameter
-
andAccumulate0
@Nonnull public <T0> AggregateOperationBuilder.Arity1<T0,A, andAccumulate0Void> (@Nonnull BiConsumerEx<? super A, ? super T0> accumulateFn0) Registers theaccumulateprimitive for stream-0. Also selects the fixed-arity variant of the aggregate operation.- Type Parameters:
T0- the expected type of item in stream-0- Parameters:
accumulateFn0- theaccumulateprimitive for stream-0. It must be stateless and cooperative.- Returns:
- a new builder object that captures the
T0type parameter
-
varArity
Selects the variable-arity variant for this aggregate operation builder.- Returns:
- a new builder object for variable-arity aggregate operations which has
the
createFnof the current builder
-
andAccumulate
@Nonnull public <T> AggregateOperationBuilder.VarArity<A,Void> andAccumulate(@Nonnull Tag<T> tag, @Nonnull BiConsumerEx<? super A, ? super T> accumulateFn) Registers theaccumulateprimitive for the stream tagged with the supplied tag. Also selects the variable-arity variant of the aggregate operation.- Type Parameters:
T- the expected type of input item- Parameters:
tag- the tag of the associated input streamaccumulateFn- theaccumulateprimitive. It must be stateless and cooperative.- Returns:
- a new builder object for variable-arity aggregate operations which has
the
createFnof the current builder
-