public class Maps extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map.Entry<K,V> |
immutableEntry(K key,
V value)
Returns an immutable map entry with the specified key and value.
|
static <K,V> HashMap<K,V> |
newHashMapWithExpectedSize(int expectedSize)
Creates a
HashMap instance with enough capacity to hold the
specified number of elements without rehashing. |
public static <K,V> Map.Entry<K,V> immutableEntry(K key, V value)
Map.Entry.setValue(V) operation throws an
UnsupportedOperationException.
The returned entry is serializable.key - the key to be associated with the returned entryvalue - the value to be associated with the returned entrypublic static <K,V> HashMap<K,V> newHashMapWithExpectedSize(int expectedSize)
HashMap instance with enough capacity to hold the
specified number of elements without rehashing.expectedSize - the expected sizeHashMap with enough
capacity to hold expectedSize elements without rehashingIllegalArgumentException - if expectedSize is negativeCopyright © 2013. All Rights Reserved.