Package grails.util

Class CollectionUtils


  • public class CollectionUtils
    extends java.lang.Object
    Collection utility methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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
      static <T> java.util.List<T> newList​(T... values)  
      static <K,​V>
      java.util.Map
      newMap​(java.lang.Object... keysAndValues)  
      static <T> java.util.Set<T> newSet​(T... values)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 map
        key - The key that holds the child map
        Returns:
        The child map