Class FlowableCollectors
java.lang.Object
com.flowable.platform.common.util.FlowableCollectors
public class FlowableCollectors
extends java.lang.Object
Util class for creating different
Collector
(s) that are not part of the Java Collectors
utils.- Author:
- Filip Hrisafov
-
Method Summary
Modifier and Type Method Description static <T> java.util.stream.Collector<T,?,java.util.List<T>>
toListWithSize(int size)
Returns aCollector
that accumulates the input elements into a newList
The created list is list that hassize
as the initial capacity.static <T> java.util.stream.Collector<T,?,java.util.Set<T>>
toSetWithSize(int expectedSize)
Returns aCollector
that accumulates the input elements into a newSet
.
-
Method Details
-
toListWithSize
public static <T> java.util.stream.Collector<T,?,java.util.List<T>> toListWithSize(int size)Returns aCollector
that accumulates the input elements into a newList
The created list is list that hassize
as the initial capacity.- Type Parameters:
T
- the type of the input elements- Returns:
- a
Collector
which collects all the input elements into aList
, in encounter order
-
toSetWithSize
public static <T> java.util.stream.Collector<T,?,java.util.Set<T>> toSetWithSize(int expectedSize)Returns aCollector
that accumulates the input elements into a newSet
. The created set is a set that hassize
as the expected initial size (taking the load factor into consideration).- Type Parameters:
T
- the type of the input elements- Returns:
- a
Collector
which collects all the input elements into aSet
-