Package grails.util

Class CollectionUtils

java.lang.Object
grails.util.CollectionUtils

public final class CollectionUtils extends Object
Collection utility methods.
  • Method Details

    • newMap

      public static <K, V> Map<K,V> newMap(Object... keysAndValues)
    • newSet

      public static <T> Set<T> newSet(T... values)
    • newList

      public static <T> List<T> newList(T... values)
    • getOrCreateChildMap

      public static Map getOrCreateChildMap(Map parent, 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 map
      key - The key that holds the child map
      Returns:
      The child map