java.lang.Object
org.alfresco.heartbeat.datasender.internal.stream.StreamUtils

public class StreamUtils extends Object
  • Method Details

    • batchCollector

      public static <T> Collector<T,List<T>,List<T>> batchCollector(int batchSize, Consumer<List<T>> batchProcessor)
      Creates a new batch collector
      Type Parameters:
      T - the type of elements being processed
      Parameters:
      batchSize - the batch size after which the batchProcessor is called
      batchProcessor - the batch processor which accepts batches of records to process
      Returns:
      a batch collector instance