Package grails.util
Class CollectionUtils
- java.lang.Object
-
- grails.util.CollectionUtils
-
public class CollectionUtils extends java.lang.ObjectCollection utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.MapgetOrCreateChildMap(java.util.Map parent, java.lang.String key)Gets a child map of the given parent map or returns an empty map if it doesn't existstatic <T> java.util.List<T>newList(T... values)static <K,V>
java.util.MapnewMap(java.lang.Object... keysAndValues)static <T> java.util.Set<T>newSet(T... values)
-
-
-
Method Detail
-
newMap
public static <K,V> java.util.Map newMap(java.lang.Object... keysAndValues)
-
newSet
public static <T> java.util.Set<T> newSet(T... values)
-
newList
public static <T> java.util.List<T> newList(T... values)
-
getOrCreateChildMap
public static java.util.Map getOrCreateChildMap(java.util.Map parent, java.lang.String key)Gets a child map of the given parent map or returns an empty map if it doesn't exist- Parameters:
parent- The parent mapkey- The key that holds the child map- Returns:
- The child map
-
-