Package org.activiti.engine.impl.util
Class CollectionUtil
java.lang.Object
org.activiti.engine.impl.util.CollectionUtil
helper/convenience methods for working with collections.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisEmpty(Collection<?> collection) static booleanisNotEmpty(Collection<?> collection) Helper method to easily create a map with keys of type String and values of type Object.mapOfClass(Class<T> clazz, Object... objects) Helper method to easily create a map with keys of type String and values of a given Class.singletonMap(String key, Object value) Helper method that creates a singleton map.
-
Method Details
-
singletonMap
Helper method that creates a singleton map. Alternative for singletonMap()), since that method returns a generic typed map <K,T> depending on the input type, but we often need a <String, Object> map. -
map
Helper method to easily create a map with keys of type String and values of type Object. Null values are allowed.- Parameters:
objects- varargs containing the key1, value1, key2, value2, etc. Note: although an Object, we will cast the key to String internally- Throws:
ActivitiIllegalArgumentException- when objects are not even or key/value are not expected types
-
mapOfClass
Helper method to easily create a map with keys of type String and values of a given Class. Null values are allowed.- Parameters:
clazz- the target Value classobjects- varargs containing the key1, value1, key2, value2, etc. Note: although an Object, we will cast the key to String internally- Throws:
ActivitiIllegalArgumentException- when objects are not even or key/value are not expected types
-
isEmpty
-
isNotEmpty
-