public final class MapUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> java.util.Map<K,V> |
augment(java.util.Map<K,V> delegate,
K extraKey,
V extraValue)
Returns a
Map that is composed of the delegate and one extra entry. |
static <K,V> java.util.Map<K,V> |
combine(java.util.Map<K,V> map1,
java.util.Map<K,V> map2)
Returns a
Map that is composed of map1 and map2. |
static boolean |
equal(java.lang.Object o1,
java.lang.Object o2)
The often-needed "equal" method that handles
null references. |
static <K,V> java.util.Map<K,V> |
fromMappings(java.lang.Object... keysAndValues) |
public static <K,V> java.util.Map<K,V> combine(java.util.Map<K,V> map1,
java.util.Map<K,V> map2)
Map that is composed of map1 and map2. Map2 is
never modified.public static <K,V> java.util.Map<K,V> augment(java.util.Map<K,V> delegate,
K extraKey,
V extraValue)
Map that is composed of the delegate and one extra entry.public static boolean equal(@Nullable java.lang.Object o1, @Nullable java.lang.Object o2)
null references.
Redeemed by java.util.Objects.equals(Object, Object) which is available since Java 1.7.
public static <K,V> java.util.Map<K,V> fromMappings(java.lang.Object... keysAndValues)
keysAndValues - An even-sized array filled alternatingly with objects of type K and VMap populated from the given key/value pairs