com.silverpeas.util
Class MapUtil

java.lang.Object
  extended by com.silverpeas.util.MapUtil

public class MapUtil
extends Object

Author:
Yohann Chastagnier

Constructor Summary
MapUtil()
           
 
Method Summary
static
<K,V> boolean
equals(Map<? extends K,? extends V> left, Map<? extends K,? extends V> right)
           
static
<K,V> Collection<V>
putAdd(Class<? extends Collection> collectionClass, Map<K,Collection<V>> map, K key, V value)
          Centralizes the map adding that containing collections
static
<K,V> Collection<V>
putAddAll(Class<? extends Collection> collectionClass, Map<K,Collection<V>> map, K key, Collection<V> values)
          Centralizes the map adding that containing collections
static
<K,V> List<V>
putAddAllList(Class<? extends List> listClass, Map<K,List<V>> map, K key, Collection<V> values)
          Centralizes the map adding that containing list collections
static
<K,V> List<V>
putAddAllList(Map<K,List<V>> map, K key, Collection<V> values)
          Centralizes the map adding that containing list collections
static
<K,V> Set<V>
putAddAllSet(Class<? extends Set> setClass, Map<K,Set<V>> map, K key, Collection<V> values)
          Centralizes the map adding that containing list collections
static
<K,V> Set<V>
putAddAllSet(Map<K,Set<V>> map, K key, Collection<V> values)
          Centralizes the map adding that containing list collections
static
<K,V> List<V>
putAddList(Class<? extends List> listClass, Map<K,List<V>> map, K key, V value)
          Centralizes the map adding that containing list collections
static
<K,V> List<V>
putAddList(Map<K,List<V>> map, K key, V value)
          Centralizes the map adding that containing list collections
static
<K,V> Set<V>
putAddSet(Class<? extends Set> setClass, Map<K,Set<V>> map, K key, V value)
          Centralizes the map adding that containing set collections
static
<K,V> Set<V>
putAddSet(Map<K,Set<V>> map, K key, V value)
          Centralizes the map adding that containing set collections
static
<K,V> List<V>
removeValueList(Map<K,List<V>> map, K key, V value)
          Centralizes the map removing that containing list collections
static
<K,V> Set<V>
removeValueSet(Map<K,Set<V>> map, K key, V value)
          Centralizes the map removing that containing set collections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapUtil

public MapUtil()
Method Detail

putAddAll

public static <K,V> Collection<V> putAddAll(Class<? extends Collection> collectionClass,
                                            Map<K,Collection<V>> map,
                                            K key,
                                            Collection<V> values)
Centralizes the map adding that containing collections

Type Parameters:
K -
V -
Parameters:
map -
key -
values -
Returns:

putAdd

public static <K,V> Collection<V> putAdd(Class<? extends Collection> collectionClass,
                                         Map<K,Collection<V>> map,
                                         K key,
                                         V value)
Centralizes the map adding that containing collections

Type Parameters:
K -
V -
Parameters:
map -
key -
value -
Returns:

putAddAllList

public static <K,V> List<V> putAddAllList(Map<K,List<V>> map,
                                          K key,
                                          Collection<V> values)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
map -
key -
values -
Returns:

putAddList

public static <K,V> List<V> putAddList(Map<K,List<V>> map,
                                       K key,
                                       V value)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
map -
key -
value -
Returns:

putAddAllSet

public static <K,V> Set<V> putAddAllSet(Map<K,Set<V>> map,
                                        K key,
                                        Collection<V> values)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
map -
key -
values -
Returns:

putAddSet

public static <K,V> Set<V> putAddSet(Map<K,Set<V>> map,
                                     K key,
                                     V value)
Centralizes the map adding that containing set collections

Type Parameters:
K -
V -
Parameters:
map -
key -
value -
Returns:

putAddAllList

public static <K,V> List<V> putAddAllList(Class<? extends List> listClass,
                                          Map<K,List<V>> map,
                                          K key,
                                          Collection<V> values)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
listClass -
map -
key -
values -
Returns:

putAddList

public static <K,V> List<V> putAddList(Class<? extends List> listClass,
                                       Map<K,List<V>> map,
                                       K key,
                                       V value)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
listClass -
map -
key -
value -
Returns:

putAddAllSet

public static <K,V> Set<V> putAddAllSet(Class<? extends Set> setClass,
                                        Map<K,Set<V>> map,
                                        K key,
                                        Collection<V> values)
Centralizes the map adding that containing list collections

Type Parameters:
K -
V -
Parameters:
setClass -
map -
key -
values -
Returns:

putAddSet

public static <K,V> Set<V> putAddSet(Class<? extends Set> setClass,
                                     Map<K,Set<V>> map,
                                     K key,
                                     V value)
Centralizes the map adding that containing set collections

Type Parameters:
K -
V -
Parameters:
setClass -
map -
key -
value -
Returns:

removeValueList

public static <K,V> List<V> removeValueList(Map<K,List<V>> map,
                                            K key,
                                            V value)
Centralizes the map removing that containing list collections

Type Parameters:
K -
V -
Parameters:
map -
key -
value -
Returns:

removeValueSet

public static <K,V> Set<V> removeValueSet(Map<K,Set<V>> map,
                                          K key,
                                          V value)
Centralizes the map removing that containing set collections

Type Parameters:
K -
V -
Parameters:
map -
key -
value -
Returns:

equals

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


Copyright © 2016 Silverpeas. All Rights Reserved.