Class MapUtil


  • public class MapUtil
    extends Object
    Utility methods on Maps.
    Author:
    Yohann Chastagnier
    • Method Detail

      • putAddAllList

        public static <K,​V> List<V> putAddAllList​(Map<K,​List<V>> map,
                                                        K key,
                                                        Collection<V> values)
      • putAddList

        public static <K,​V> List<V> putAddList​(Map<K,​List<V>> map,
                                                     K key,
                                                     V value)
      • putAddAllSet

        public static <K,​V> Set<V> putAddAllSet​(Map<K,​Set<V>> map,
                                                      K key,
                                                      Collection<V> values)
      • putAddSet

        public static <K,​V> Set<V> putAddSet​(Map<K,​Set<V>> map,
                                                   K key,
                                                   V value)
      • putAddList

        public static <K,​V> List<V> putAddList​(Supplier<? extends List<V>> factory,
                                                     Map<K,​List<V>> map,
                                                     K key,
                                                     V value)
      • putAddAllSet

        public static <K,​V> Set<V> putAddAllSet​(Supplier<? extends Set<V>> factory,
                                                      Map<K,​Set<V>> map,
                                                      K key,
                                                      Collection<V> values)
      • putAddSet

        public static <K,​V> Set<V> putAddSet​(Supplier<? extends Set<V>> factory,
                                                   Map<K,​Set<V>> map,
                                                   K key,
                                                   V value)
      • removeValueList

        public static <K,​V> List<V> removeValueList​(Map<K,​List<V>> map,
                                                          K key,
                                                          V value)
      • removeValueSet

        public static <K,​V> Set<V> removeValueSet​(Map<K,​Set<V>> map,
                                                        K key,
                                                        V value)
      • areEqual

        public static <K,​V> boolean areEqual​(Map<? extends K,​? extends V> left,
                                                   Map<? extends K,​? extends V> right)