| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<? super T>,R> |
sorting(Collector<T,?,R> downstreamCollector)
Returns a
Collector that will sort elements of the stream before passing them to the downstream collector. |
static <T,R> Collector<T,?,R> |
sorting(Comparator<? super T> comparator,
Collector<T,?,R> downstreamCollector)
Returns a
Collector that will sort elements of the stream using the given comparator before passing
them to the downstream collector. |
public static <T extends Comparable<? super T>,R> Collector<T,?,R> sorting(Collector<T,?,R> downstreamCollector)
Collector that will sort elements of the stream before passing them to the downstream collector.T - the types of the input elementsR - the result type of the collectordownstreamCollector - a collector that will accept the sorted elementspublic static <T,R> Collector<T,?,R> sorting(Comparator<? super T> comparator, Collector<T,?,R> downstreamCollector)
Collector that will sort elements of the stream using the given comparator before passing
them to the downstream collector.T - the types of the input elementsR - the result type of the collectorcomparator - the comparator used to compare the elements of the streamdownstreamCollector - a collector that will accept the sorted elementsCopyright © 2022. All rights reserved.