Class BatchCollector<T>

  • Type Parameters:
    T - Type of the elements being collected
    All Implemented Interfaces:
    Collector<T,​List<T>,​List<T>>

    public class BatchCollector<T>
    extends Object
    implements Collector<T,​List<T>,​List<T>>
    Collects elements in the stream and calls the supplied batch processor after the configured batch size is reached. In case of a parallel stream, the batch processor may be called with elements less than the batch size. The final result is an empty list.