Class PickAnyAccumulator<T>

  • Type Parameters:
    T -

    public class PickAnyAccumulator<T>
    extends java.lang.Object
    Keeps the state needed to implement the AggregateOperations.pickAny() aggregate operation. It maintains the count of accumulated items so that it can properly set its value to null when all the items are deducted.
    Since:
    Jet 4.5
    • Constructor Summary

      Constructors 
      Constructor Description
      PickAnyAccumulator()
      Constructs an empty pickAny accumulator.
      PickAnyAccumulator​(T value)
      Constructs a pickAny accumulator with the full state passed in the parameters.
    • Constructor Detail

      • PickAnyAccumulator

        public PickAnyAccumulator()
        Constructs an empty pickAny accumulator.
      • PickAnyAccumulator

        public PickAnyAccumulator​(T value)
        Constructs a pickAny accumulator with the full state passed in the parameters.
        Parameters:
        value - the picked object
    • Method Detail

      • accumulate

        public void accumulate​(@Nullable
                               T t)
        Accumulates an item.
      • combine

        public void combine​(@Nonnull
                            PickAnyAccumulator<T> other)
        Combines another accumulator with this one.
      • get

        public T get()
        Returns the picked object.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object