Class CollectorFactory


  • public final class CollectorFactory
    extends java.lang.Object
    Factory creating collectors for aggregation functions
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​A,​R>
      java.util.function.Function<Expression<T,​R>,​java.util.stream.Collector<T,​A,​R>>
      collector​(CollectorType collectorType)
      Creates collector from collector type
      static <T,​A,​R>
      java.util.stream.Collector<T,​A,​R>
      filtering​(java.util.function.Predicate<? super T> filter, java.util.stream.Collector<T,​A,​R> collector)
      Filtering collector
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • collector

        public static <T,​A,​R> java.util.function.Function<Expression<T,​R>,​java.util.stream.Collector<T,​A,​R>> collector​(CollectorType collectorType)
        Creates collector from collector type
        Type Parameters:
        T - Input parameter type
        A - Accumulator type
        R - Return parameter type
        Parameters:
        collectorType - Collector type
        Returns:
        Function creating collector
      • filtering

        public static <T,​A,​R> java.util.stream.Collector<T,​A,​R> filtering​(java.util.function.Predicate<? super T> filter,
                                                                                                  java.util.stream.Collector<T,​A,​R> collector)
        Filtering collector
        Type Parameters:
        T - Input parameter type
        A - Accumulator type
        R - Return parameter type
        Parameters:
        filter - Predicate to filter
        collector - Collector in chain
        Returns:
        Collector instance