K - the type of the Map's keys.V - the type of the Map's values.public final class ImmutableMap<K,V> extends AbstractMap<K,V> implements Serializable
Map. This implementation provides a predictable iteration
order by remembering the order in which keys were inserted into the
Map (insertion-order). Note that insertion order is not affected if
a key is re-inserted into the Map. Accepts null values and
the null key.| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableMap.Builder<K,V>
ImmutableMap builder. |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> Map<K,V> |
copyOf(Map<? extends K,? extends V> map)
Creates a new
ImmutableSet from the given Iterable. |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, hashCode, toStringpublic static <K,V> Map<K,V> copyOf(Map<? extends K,? extends V> map)
ImmutableSet from the given Iterable.K - the type of the Map's keys.V - the type of the Map's values.map - the source Map.ImmutableMap.NullPointerException - if map is null.public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in class AbstractMap<K,V>public void clear()
public Collection<V> values()
Copyright © 2012–2015. All rights reserved.