Class CollectionUtil
java.lang.Object
org.flowable.common.engine.impl.util.CollectionUtil
helper/convenience methods for working with collections.
- Author:
- Joram Barrez
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
consumePartitions
(Collection<T> values, int partitionSize, Consumer<List<T>> partitionConsumer) static boolean
isEmpty
(Collection collection) static boolean
isNotEmpty
(Collection collection) Helper method to easily create a map.partition
(Collection<T> values, int partitionSize) singletonMap
(String key, Object value) Helper method that creates a singleton map.
-
Method Details
-
singletonMap
Helper method that creates a singleton map. Alternative for Collections.singletonMap(), since that method returns a generic typed map depending on the input type, but we often need a String, Object map. -
map
Helper method to easily create a map. Takes as input a varargs containing the key1, value1, key2, value2, etc. Note: although an Object, we will cast the key to String internally. -
isEmpty
-
isNotEmpty
-
partition
-
consumePartitions
public static <T> void consumePartitions(Collection<T> values, int partitionSize, Consumer<List<T>> partitionConsumer)
-