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 aCollectorthat accumulates the input elements into a newListThe created list is list that hassizeas the initial capacity.static <T> java.util.stream.Collector<T,?,java.util.Set<T>>toSetWithSize(int expectedSize)Returns aCollectorthat 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 aCollectorthat accumulates the input elements into a newListThe created list is list that hassizeas the initial capacity.- Type Parameters:
T- the type of the input elements- Returns:
- a
Collectorwhich 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 aCollectorthat accumulates the input elements into a newSet. The created set is a set that hassizeas the expected initial size (taking the load factor into consideration).- Type Parameters:
T- the type of the input elements- Returns:
- a
Collectorwhich collects all the input elements into aSet
-