| Package | Description | 
|---|---|
| java.util.stream | Classes to support functional-style operations on streams of elements, such
 as map-reduce transformations on collections. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <T> Collector<T,?,Double> | Collectors. averagingDouble(ToDoubleFunction<? super T> mapper)Returns a  Collectorthat produces the arithmetic mean of a double-valued
 function applied to the input elements. | 
| static <T> Collector<T,?,Double> | Collectors. averagingInt(ToIntFunction<? super T> mapper)Returns a  Collectorthat produces the arithmetic mean of an integer-valued
 function applied to the input elements. | 
| static <T> Collector<T,?,Double> | Collectors. averagingLong(ToLongFunction<? super T> mapper)Returns a  Collectorthat produces the arithmetic mean of a long-valued
 function applied to the input elements. | 
| static <T,A,R,RR> Collector<T,A,RR> | Collectors. collectingAndThen(Collector<T,A,R> downstream,
                 Function<R,RR> finisher)Adapts a  Collectorto perform an additional finishing
 transformation. | 
| static <T> Collector<T,?,Long> | Collectors. counting()Returns a  Collectoraccepting elements of typeTthat
 counts the number of input elements. | 
| static <T,K> Collector<T,?,Map<K,List<T>>> | Collectors. groupingBy(Function<? super T,? extends K> classifier)Returns a  Collectorimplementing a "group by" operation on
 input elements of typeT, grouping elements according to a
 classification function, and returning the results in aMap. | 
| static <T,K,A,D> Collector<T,?,Map<K,D>> | Collectors. groupingBy(Function<? super T,? extends K> classifier,
          Collector<? super T,A,D> downstream)Returns a  Collectorimplementing a cascaded "group by" operation
 on input elements of typeT, grouping elements according to a
 classification function, and then performing a reduction operation on
 the values associated with a given key using the specified downstreamCollector. | 
| static <T,K,D,A,M extends Map<K,D>> | Collectors. groupingBy(Function<? super T,? extends K> classifier,
          Supplier<M> mapFactory,
          Collector<? super T,A,D> downstream)Returns a  Collectorimplementing a cascaded "group by" operation
 on input elements of typeT, grouping elements according to a
 classification function, and then performing a reduction operation on
 the values associated with a given key using the specified downstreamCollector. | 
| static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> | Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier)Returns a concurrent  Collectorimplementing a "group by"
 operation on input elements of typeT, grouping elements
 according to a classification function. | 
| static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> | Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier,
                    Collector<? super T,A,D> downstream)Returns a concurrent  Collectorimplementing a cascaded "group by"
 operation on input elements of typeT, grouping elements
 according to a classification function, and then performing a reduction
 operation on the values associated with a given key using the specified
 downstreamCollector. | 
| static <T,K,A,D,M extends ConcurrentMap<K,D>> | Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier,
                    Supplier<M> mapFactory,
                    Collector<? super T,A,D> downstream)Returns a concurrent  Collectorimplementing a cascaded "group by"
 operation on input elements of typeT, grouping elements
 according to a classification function, and then performing a reduction
 operation on the values associated with a given key using the specified
 downstreamCollector. | 
| static Collector<CharSequence,?,String> | Collectors. joining()Returns a  Collectorthat concatenates the input elements into aString, in encounter order. | 
| static Collector<CharSequence,?,String> | Collectors. joining(CharSequence delimiter)Returns a  Collectorthat concatenates the input elements,
 separated by the specified delimiter, in encounter order. | 
| static Collector<CharSequence,?,String> | Collectors. joining(CharSequence delimiter,
       CharSequence prefix,
       CharSequence suffix)Returns a  Collectorthat concatenates the input elements,
 separated by the specified delimiter, with the specified prefix and
 suffix, in encounter order. | 
| static <T,U,A,R> Collector<T,?,R> | Collectors. mapping(Function<? super T,? extends U> mapper,
       Collector<? super U,A,R> downstream)Adapts a  Collectoraccepting elements of typeUto one
 accepting elements of typeTby applying a mapping function to
 each input element before accumulation. | 
| static <T> Collector<T,?,Optional<T>> | Collectors. maxBy(Comparator<? super T> comparator)Returns a  Collectorthat produces the maximal element according
 to a givenComparator, described as anOptional<T>. | 
| static <T> Collector<T,?,Optional<T>> | Collectors. minBy(Comparator<? super T> comparator)Returns a  Collectorthat produces the minimal element according
 to a givenComparator, described as anOptional<T>. | 
| static <T,A,R> Collector<T,A,R> | Collector. of(Supplier<A> supplier,
  BiConsumer<A,T> accumulator,
  BinaryOperator<A> combiner,
  Function<A,R> finisher,
  Collector.Characteristics... characteristics)Returns a new  Collectordescribed by the givensupplier,accumulator,combiner, andfinisherfunctions. | 
| static <T,R> Collector<T,R,R> | Collector. of(Supplier<R> supplier,
  BiConsumer<R,T> accumulator,
  BinaryOperator<R> combiner,
  Collector.Characteristics... characteristics)Returns a new  Collectordescribed by the givensupplier,accumulator, andcombinerfunctions. | 
| static <T> Collector<T,?,Map<Boolean,List<T>>> | Collectors. partitioningBy(Predicate<? super T> predicate)Returns a  Collectorwhich partitions the input elements according
 to aPredicate, and organizes them into aMap<Boolean, List<T>>. | 
| static <T,D,A> Collector<T,?,Map<Boolean,D>> | Collectors. partitioningBy(Predicate<? super T> predicate,
              Collector<? super T,A,D> downstream)Returns a  Collectorwhich partitions the input elements according
 to aPredicate, reduces the values in each partition according to
 anotherCollector, and organizes them into aMap<Boolean, D>whose values are the result of the downstream
 reduction. | 
| static <T> Collector<T,?,Optional<T>> | Collectors. reducing(BinaryOperator<T> op)Returns a  Collectorwhich performs a reduction of its
 input elements under a specifiedBinaryOperator. | 
| static <T> Collector<T,?,T> | Collectors. reducing(T identity,
        BinaryOperator<T> op)Returns a  Collectorwhich performs a reduction of its
 input elements under a specifiedBinaryOperatorusing the
 provided identity. | 
| static <T,U> Collector<T,?,U> | Collectors. reducing(U identity,
        Function<? super T,? extends U> mapper,
        BinaryOperator<U> op)Returns a  Collectorwhich performs a reduction of its
 input elements under a specified mapping function andBinaryOperator. | 
| static <T> Collector<T,?,DoubleSummaryStatistics> | Collectors. summarizingDouble(ToDoubleFunction<? super T> mapper)Returns a  Collectorwhich applies andouble-producing
 mapping function to each input element, and returns summary statistics
 for the resulting values. | 
| static <T> Collector<T,?,IntSummaryStatistics> | Collectors. summarizingInt(ToIntFunction<? super T> mapper)Returns a  Collectorwhich applies anint-producing
 mapping function to each input element, and returns summary statistics
 for the resulting values. | 
| static <T> Collector<T,?,LongSummaryStatistics> | Collectors. summarizingLong(ToLongFunction<? super T> mapper)Returns a  Collectorwhich applies anlong-producing
 mapping function to each input element, and returns summary statistics
 for the resulting values. | 
| static <T> Collector<T,?,Double> | Collectors. summingDouble(ToDoubleFunction<? super T> mapper)Returns a  Collectorthat produces the sum of a double-valued
 function applied to the input elements. | 
| static <T> Collector<T,?,Integer> | Collectors. summingInt(ToIntFunction<? super T> mapper)Returns a  Collectorthat produces the sum of a integer-valued
 function applied to the input elements. | 
| static <T> Collector<T,?,Long> | Collectors. summingLong(ToLongFunction<? super T> mapper)Returns a  Collectorthat produces the sum of a long-valued
 function applied to the input elements. | 
| static <T,C extends Collection<T>> | Collectors. toCollection(Supplier<C> collectionFactory)Returns a  Collectorthat accumulates the input elements into a
 newCollection, in encounter order. | 
| static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> | Collectors. toConcurrentMap(Function<? super T,? extends K> keyMapper,
               Function<? super T,? extends U> valueMapper)Returns a concurrent  Collectorthat accumulates elements into aConcurrentMapwhose keys and values are the result of applying
 the provided mapping functions to the input elements. | 
| static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> | Collectors. toConcurrentMap(Function<? super T,? extends K> keyMapper,
               Function<? super T,? extends U> valueMapper,
               BinaryOperator<U> mergeFunction)Returns a concurrent  Collectorthat accumulates elements into aConcurrentMapwhose keys and values are the result of applying
 the provided mapping functions to the input elements. | 
| static <T,K,U,M extends ConcurrentMap<K,U>> | Collectors. toConcurrentMap(Function<? super T,? extends K> keyMapper,
               Function<? super T,? extends U> valueMapper,
               BinaryOperator<U> mergeFunction,
               Supplier<M> mapSupplier)Returns a concurrent  Collectorthat accumulates elements into aConcurrentMapwhose keys and values are the result of applying
 the provided mapping functions to the input elements. | 
| static <T> Collector<T,?,List<T>> | Collectors. toList()Returns a  Collectorthat accumulates the input elements into a
 newList. | 
| static <T,K,U> Collector<T,?,Map<K,U>> | Collectors. toMap(Function<? super T,? extends K> keyMapper,
     Function<? super T,? extends U> valueMapper)Returns a  Collectorthat accumulates elements into aMapwhose keys and values are the result of applying the provided
 mapping functions to the input elements. | 
| static <T,K,U> Collector<T,?,Map<K,U>> | Collectors. toMap(Function<? super T,? extends K> keyMapper,
     Function<? super T,? extends U> valueMapper,
     BinaryOperator<U> mergeFunction)Returns a  Collectorthat accumulates elements into aMapwhose keys and values are the result of applying the provided
 mapping functions to the input elements. | 
| static <T,K,U,M extends Map<K,U>> | Collectors. toMap(Function<? super T,? extends K> keyMapper,
     Function<? super T,? extends U> valueMapper,
     BinaryOperator<U> mergeFunction,
     Supplier<M> mapSupplier)Returns a  Collectorthat accumulates elements into aMapwhose keys and values are the result of applying the provided
 mapping functions to the input elements. | 
| static <T> Collector<T,?,Set<T>> | Collectors. toSet()Returns a  Collectorthat accumulates the input elements into a
 newSet. | 
| Modifier and Type | Method and Description | 
|---|---|
| <R,A> R | Stream. collect(Collector<? super T,A,R> collector)Performs a mutable
 reduction operation on the elements of this stream using a
  Collector. | 
| static <T,A,R,RR> Collector<T,A,RR> | Collectors. collectingAndThen(Collector<T,A,R> downstream,
                 Function<R,RR> finisher)Adapts a  Collectorto perform an additional finishing
 transformation. | 
| static <T,K,A,D> Collector<T,?,Map<K,D>> | Collectors. groupingBy(Function<? super T,? extends K> classifier,
          Collector<? super T,A,D> downstream)Returns a  Collectorimplementing a cascaded "group by" operation
 on input elements of typeT, grouping elements according to a
 classification function, and then performing a reduction operation on
 the values associated with a given key using the specified downstreamCollector. | 
| static <T,K,D,A,M extends Map<K,D>> | Collectors. groupingBy(Function<? super T,? extends K> classifier,
          Supplier<M> mapFactory,
          Collector<? super T,A,D> downstream)Returns a  Collectorimplementing a cascaded "group by" operation
 on input elements of typeT, grouping elements according to a
 classification function, and then performing a reduction operation on
 the values associated with a given key using the specified downstreamCollector. | 
| static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> | Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier,
                    Collector<? super T,A,D> downstream)Returns a concurrent  Collectorimplementing a cascaded "group by"
 operation on input elements of typeT, grouping elements
 according to a classification function, and then performing a reduction
 operation on the values associated with a given key using the specified
 downstreamCollector. | 
| static <T,K,A,D,M extends ConcurrentMap<K,D>> | Collectors. groupingByConcurrent(Function<? super T,? extends K> classifier,
                    Supplier<M> mapFactory,
                    Collector<? super T,A,D> downstream)Returns a concurrent  Collectorimplementing a cascaded "group by"
 operation on input elements of typeT, grouping elements
 according to a classification function, and then performing a reduction
 operation on the values associated with a given key using the specified
 downstreamCollector. | 
| static <T,U,A,R> Collector<T,?,R> | Collectors. mapping(Function<? super T,? extends U> mapper,
       Collector<? super U,A,R> downstream)Adapts a  Collectoraccepting elements of typeUto one
 accepting elements of typeTby applying a mapping function to
 each input element before accumulation. | 
| static <T,D,A> Collector<T,?,Map<Boolean,D>> | Collectors. partitioningBy(Predicate<? super T> predicate,
              Collector<? super T,A,D> downstream)Returns a  Collectorwhich partitions the input elements according
 to aPredicate, reduces the values in each partition according to
 anotherCollector, and organizes them into aMap<Boolean, D>whose values are the result of the downstream
 reduction. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.