org.camunda.bpm.engine.impl.util
Class CollectionUtil

java.lang.Object
  extended by org.camunda.bpm.engine.impl.util.CollectionUtil

public class CollectionUtil
extends Object

helper/convience methods for working with collections.

Author:
Joram Barrez

Method Summary
static
<S,T> void
addCollectionToMapOfSets(Map<S,Set<T>> map, S key, Collection<T> values)
           
static
<S,T> void
addToMapOfLists(Map<S,List<T>> map, S key, T value)
           
static
<S,T> void
addToMapOfSets(Map<S,Set<T>> map, S key, T value)
           
static
<T> List<T>
asArrayList(T[] values)
          Arrays.asList cannot be reliably used for SQL parameters on MyBatis < 3.3.0
static
<T> Set<T>
asHashSet(T... elements)
           
static Map<String,Object> singletonMap(String key, Object value)
          Helper method that creates a singleton map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

singletonMap

public static Map<String,Object> singletonMap(String key,
                                              Object value)
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 map.


asArrayList

public static <T> List<T> asArrayList(T[] values)
Arrays.asList cannot be reliably used for SQL parameters on MyBatis < 3.3.0


asHashSet

public static <T> Set<T> asHashSet(T... elements)

addToMapOfLists

public static <S,T> void addToMapOfLists(Map<S,List<T>> map,
                                         S key,
                                         T value)

addToMapOfSets

public static <S,T> void addToMapOfSets(Map<S,Set<T>> map,
                                        S key,
                                        T value)

addCollectionToMapOfSets

public static <S,T> void addCollectionToMapOfSets(Map<S,Set<T>> map,
                                                  S key,
                                                  Collection<T> values)


Copyright © 2017 camunda services GmbH. All rights reserved.