Class FlowableCollectors
- java.lang.Object
-
- com.flowable.platform.common.util.FlowableCollectors
-
public class FlowableCollectors extends Object
Util class for creating differentCollector
(s) that are not part of the JavaCollectors
utils.- Author:
- Filip Hrisafov
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Collector<T,?,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> Collector<T,?,Set<T>>
toSetWithSize(int expectedSize)
Returns aCollector
that accumulates the input elements into a newSet
.
-
-
-
Method Detail
-
toListWithSize
public static <T> Collector<T,?,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> Collector<T,?,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
-
-