Class ListCollector<T>

  • Type Parameters:
    T - The type of the collected elements.
    All Implemented Interfaces:
    Collector<T>

    @Internal
    public class ListCollector<T>
    extends Object
    implements Collector<T>
    A Collector that puts the collected elements into a given list.
    • Constructor Detail

      • ListCollector

        public ListCollector​(List<T> list)
    • Method Detail

      • collect

        public void collect​(T record)
        Description copied from interface: Collector
        Emits a record.
        Specified by:
        collect in interface Collector<T>
        Parameters:
        record - The record to collect.
      • close

        public void close()
        Description copied from interface: Collector
        Closes the collector. If any data was buffered, that data will be flushed.
        Specified by:
        close in interface Collector<T>