com.google.cloud.dataflow.sdk.transforms

## Class Max.MaxFn<T>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn<V,Combine.Holder<V>,V>
  - - com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineFn<T>
    - - com.google.cloud.dataflow.sdk.transforms.Max.MaxFn<T>

Type Parameters:
  `T` - the type of the values being compared

All Implemented Interfaces:
  CombineFnBase.GlobalCombineFn<T,Combine.Holder<T>,T>, HasDisplayData, Serializable

Direct Known Subclasses:
  Max.MaxDoubleFn, Max.MaxIntegerFn, Max.MaxLongFn

Enclosing class:
  Max

    public static class Max.MaxFn<T>
    extends Combine.BinaryCombineFn<T>

A `CombineFn` that computes the maximum of a collection of elements of type `T` using an arbitrary `Comparator`, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.

See Also:
  Serialized Form

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`T` `apply(T left, T right)` Applies the binary operation to the two operands, returning the result.
`TypeVariable<?>` `getAccumTVariable()` Returns the `TypeVariable` of `AccumT`.
`String` `getIncompatibleGlobalWindowErrorMessage()` Returns the error message for not supported default values in Combine.globally().
`TypeVariable<?>` `getInputTVariable()` Returns the `TypeVariable` of `InputT`.
`TypeVariable<?>` `getOutputTVariable()` Returns the `TypeVariable` of `OutputT`.
`T` `identity()` Returns the value that should be used for the combine of the empty set.
`static <T extends Comparable<? super T>> Max.MaxFn<T>` `naturalOrder()`
`static <T extends Comparable<? super T>> Max.MaxFn<T>` `naturalOrder(T identity)`
`static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T>` `of(ComparatorT comparator)`
`static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T>` `of(T identity, ComparatorT comparator)`
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineFn

`addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulators`

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn

`apply, asKeyedFn, compact, defaultValue, getOutputType`

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

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

### Method Detail

#### of

    public static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(T identity,
                                                                                               ComparatorT comparator)

#### of

    public static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(ComparatorT comparator)

#### naturalOrder

    public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder(T identity)

#### naturalOrder

    public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder()

#### identity

    public T identity()

Description copied from class: `Combine.BinaryCombineFn`
Returns the value that should be used for the combine of the empty set.

Overrides:
  `identity` in class `Combine.BinaryCombineFn<T>`

#### apply

    public T apply(T left,
                   T right)

Description copied from class: `Combine.BinaryCombineFn`
Applies the binary operation to the two operands, returning the result.

Specified by:
  `apply` in class `Combine.BinaryCombineFn<T>`

#### populateDisplayData

    public void populateDisplayData(DisplayData.Builder builder)

Register display data for the given transform or component.

`populateDisplayData(DisplayData.Builder)` is invoked by Pipeline runners to collect display data via `DisplayData.from(HasDisplayData)`. Implementations may call `super.populateDisplayData(builder)` in order to register display data in the current namespace, but should otherwise use `subcomponent.populateDisplayData(builder)` to use the namespace of the subcomponent.

By default, does not register any display data. Implementors may override this method to provide their own display data.

Specified by:
  `populateDisplayData` in interface `HasDisplayData`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`

#### getIncompatibleGlobalWindowErrorMessage

    public String getIncompatibleGlobalWindowErrorMessage()

Description copied from interface: `CombineFnBase.GlobalCombineFn`
Returns the error message for not supported default values in Combine.globally().

Specified by:
  `getIncompatibleGlobalWindowErrorMessage` in interface `CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>`

#### getInputTVariable

    public TypeVariable<?> getInputTVariable()

Returns the `TypeVariable` of `InputT`.

#### getAccumTVariable

    public TypeVariable<?> getAccumTVariable()

Returns the `TypeVariable` of `AccumT`.

#### getOutputTVariable

    public TypeVariable<?> getOutputTVariable()

Returns the `TypeVariable` of `OutputT`.