Class FlowableCollectors
- java.lang.Object
-
- com.flowable.platform.common.util.FlowableCollectors
-
public class FlowableCollectors extends java.lang.ObjectUtil class for creating differentCollector(s) that are not part of the JavaCollectorsutils.- Author:
- Filip Hrisafov
-
-
Method Summary
All Methods Static Methods Concrete Methods 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 Detail
-
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
-
-