com.hazelcast.jet.aggregate

## Class CoAggregateOperationBuilder

- java.lang.Object
- - com.hazelcast.jet.aggregate.CoAggregateOperationBuilder

-     public class CoAggregateOperationBuilder
      extends Object

  Offers a step-by-step API to create an aggregate operation that accepts multiple inputs. To obtain it, call `AggregateOperations.coAggregateOperationBuilder()`. and refer to that method's Javadoc for further details.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T,R> Tag<R>` | `add(Tag<T> tag, AggregateOperation1<? super T,?,? extends R> operation)` Registers the given aggregate operation with the tag corresponding to an input to the co-aggregating operation being built.
    `AggregateOperation<Object[],ItemsByTag>` | `build()` Builds and returns the `AggregateOperation`.
    `<R> AggregateOperation<Object[],R>` | `build(DistributedFunction<? super ItemsByTag,? extends R> exportFinishFn)` Builds and returns the multi-input `AggregateOperation`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### add

          @Nonnull
          public <T,R> Tag<R> add(@Nonnull
                                           Tag<T> tag,
                                           @Nonnull
                                           AggregateOperation1<? super T,?,? extends R> operation)

      Registers the given aggregate operation with the tag corresponding to an input to the co-aggregating operation being built. If you are preparing an operation to pass to an aggregate builder, you must use the tags you obtained from it.

      Returns the tag you'll use to retrieve the results of aggregating this input.

      Type Parameters:
        `T` - type of this operation's input
        `R` - the result type of this operation
      Returns:
        the result tag

    - #### build

          @Nonnull
          public AggregateOperation<Object[],ItemsByTag> build()

      Builds and returns the `AggregateOperation`. Its result type is `ItemsByTag` containing all the tags you got from the `add(com.hazelcast.jet.datamodel.Tag<T>, com.hazelcast.jet.aggregate.AggregateOperation1<? super T, ?, ? extends R>)` method.

    - #### build

          @Nonnull
          public <R> AggregateOperation<Object[],R> build(@Nonnull
                                                                   DistributedFunction<? super ItemsByTag,? extends R> exportFinishFn)

      Builds and returns the multi-input `AggregateOperation`. It will call the supplied `exportFinishFn` to transform the `ItemsByTag` it creates to the result type it emits as the actual result.
      Parameters:
        `exportFinishFn` - function to convert `ItemsByTag` to the target result type

Copyright © 2018. All rights reserved.