public class FlowableCollectors extends Object
Collector(s) that are not part of the Java Collectors utils.| Modifier and Type | Method and Description |
|---|---|
static <T> Collector<T,?,List<T>> |
toListWithSize(int size)
Returns a
Collector that accumulates the input elements into a
new List The created list is list that has size as the initial capacity. |
static <T> Collector<T,?,Set<T>> |
toSetWithSize(int expectedSize)
Returns a
Collector that accumulates the input elements into a
new Set. |
public static <T> Collector<T,?,List<T>> toListWithSize(int size)
Collector that accumulates the input elements into a
new List The created list is list that has size as the initial capacity.T - the type of the input elementsCollector which collects all the input elements into a
List, in encounter orderpublic static <T> Collector<T,?,Set<T>> toSetWithSize(int expectedSize)
Collector that accumulates the input elements into a
new Set. The created set is a set that has size as the
expected initial size (taking the load factor into consideration).T - the type of the input elementsCollector which collects all the input elements into a
SetCopyright © 2019. All rights reserved.