public final class MapUtils
extends java.lang.Object
| Constructor and Description |
|---|
MapUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> DoubleMap<K,V> |
copyDoubleMap(DoubleMap<K,V> map)
Returns copied DoubleMap.
|
static <K,V> java.util.HashMap<K,V> |
copyHashMap(java.util.HashMap<K,V> map)
Returns copied HashMap.
|
static <K,V> java.util.LinkedHashMap<K,V> |
copyLinkedHashMap(java.util.LinkedHashMap<K,V> map)
Returns copied LinkedHashMap.
|
static <K,V> java.util.HashMap<K,V> |
copyMap(java.util.Map<K,V> map)
Returns copied Map.
|
static boolean |
isEmpty(java.util.Map<?,?> map)
Returns whether specified map is empty or not.
|
static <K,V> java.util.HashMap<K,V> |
merge(java.util.Map<K,V>... maps)
Merges specified maps into one new map and returns it.
|
static <K,V> java.util.HashMap<K,V> |
newHashMap(K key,
V value)
Returns newly created HashMap with the specified key and value pair added.
|
static <K,V> java.util.HashMap<K,V> |
newHashMap(java.lang.Object... objects)
Returns newly created HashMap with the specified key and value pairs added.
|
static <K,V> java.util.LinkedHashMap<K,V> |
newLinkedHashMap(K key,
V value)
Returns newly created LinkedHashMap with the specified key and value pair added.
|
static <K,V> java.util.LinkedHashMap<K,V> |
newLinkedHashMap(java.lang.Object... objects)
Returns newly created LinkedHashMap with the specified key and value pairs added.
|
static <K,V> void |
removeAllValues(java.util.Map<K,V> map,
V value)
Removes all map entries where value is the same as the specified one.
|
public static boolean isEmpty(java.util.Map<?,?> map)
map - map to processpublic static <K,V> java.util.HashMap<K,V> copyMap(java.util.Map<K,V> map)
K - Map key typeV - Map value typemap - Map to copypublic static <K,V> java.util.HashMap<K,V> copyHashMap(java.util.HashMap<K,V> map)
K - HashMap key typeV - HashMap value typemap - HashMap to copypublic static <K,V> java.util.LinkedHashMap<K,V> copyLinkedHashMap(java.util.LinkedHashMap<K,V> map)
K - LinkedHashMap key typeV - LinkedHashMap value typemap - LinkedHashMap to copypublic static <K,V> DoubleMap<K,V> copyDoubleMap(DoubleMap<K,V> map)
K - DoubleMap key typeV - DoubleMap value typemap - DoubleMap to copypublic static <K,V> java.util.HashMap<K,V> newHashMap(K key,
V value)
K - key typeV - value typekey - key to addvalue - value to addpublic static <K,V> java.util.HashMap<K,V> newHashMap(java.lang.Object... objects)
K - key typeV - value typeobjects - key-value pairspublic static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMap(K key,
V value)
K - key typeV - value typekey - key to addvalue - value to addpublic static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMap(java.lang.Object... objects)
K - key typeV - value typeobjects - key-value pairspublic static <K,V> void removeAllValues(java.util.Map<K,V> map,
V value)
K - key typeV - value typemap - map to remove entries fromvalue - value for which entries should be removedpublic static <K,V> java.util.HashMap<K,V> merge(java.util.Map<K,V>... maps)
K - key typeV - value typemaps - maps to merge into new one