K - the key typeV - the value type@Immutable public class ImmutableMap<K,V> extends AbstractMap<K,V> implements Immutable
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableMap.Builder<K,V> |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
static <K,V> ImmutableMap.Builder<K,V> |
builder() |
static <K,V> ImmutableMap.Builder<K,V> |
builder(Map<K,V> backedMap) |
void |
clear()
Deprecated.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> ImmutableMap<K,V> |
copyOf(Map<? extends K,? extends V> map) |
static <K,V> ImmutableMap<K,V> |
empty() |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
V |
getOrDefault(Object key,
V defaultValue)
Gets the or default.
|
boolean |
isEmpty()
Checks if is empty.
|
Set<K> |
keySet() |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6) |
static <K,V> ImmutableMap<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7) |
static <K,V> ImmutableMap<K,V> |
of(Map<? extends K,? extends V> map) |
V |
put(K k,
V v)
Deprecated.
throws
UnsupportedOperationException |
void |
putAll(Map<? extends K,? extends V> map)
Deprecated.
throws
UnsupportedOperationException |
V |
remove(Object o)
Deprecated.
throws
UnsupportedOperationException |
int |
size() |
Collection<V> |
values() |
equals, hashCode, toStringcompute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAllpublic static <K,V> ImmutableMap<K,V> empty()
K - the key typeV - the value typepublic static <K,V> ImmutableMap<K,V> of(K k1, V v1)
K - the key typeV - the value typek - v - k1 - v1 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - k3 - v3 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - k3 - v3 - k4 - v4 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - k3 - v3 - k4 - v4 - k5 - v5 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - k3 - v3 - k4 - v4 - k5 - v5 - k6 - v6 - public static <K,V> ImmutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
K - the key typeV - the value typek - v - k1 - v1 - k2 - v2 - k3 - v3 - k4 - v4 - k5 - v5 - k6 - v6 - k7 - v7 - public static <K,V> ImmutableMap<K,V> of(Map<? extends K,? extends V> map)
K - the key typeV - the value typemap - the elements in this map are shared by the returned ImmutableMap.public static <K,V> ImmutableMap<K,V> copyOf(Map<? extends K,? extends V> map)
K - the key typeV - the value typemap - public V getOrDefault(Object key, V defaultValue)
getOrDefault in interface Map<K,V>key - defaultValue - @Deprecated public final V put(K k, V v) throws UnsupportedOperationException
UnsupportedOperationExceptionput in interface Map<K,V>put in class AbstractMap<K,V>k - v - UnsupportedOperationException@Deprecated public final V remove(Object o) throws UnsupportedOperationException
UnsupportedOperationExceptionremove in interface Map<K,V>remove in class AbstractMap<K,V>o - UnsupportedOperationException@Deprecated public final void putAll(Map<? extends K,? extends V> map) throws UnsupportedOperationException
UnsupportedOperationExceptionputAll in interface Map<K,V>putAll in class AbstractMap<K,V>map - UnsupportedOperationException@Deprecated public final void clear() throws UnsupportedOperationException
clear in interface Map<K,V>clear in class AbstractMap<K,V>UnsupportedOperationExceptionpublic boolean isEmpty()
public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>key - public boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in class AbstractMap<K,V>value - public Collection<V> values()
public int size()
public static <K,V> ImmutableMap.Builder<K,V> builder()
public static <K,V> ImmutableMap.Builder<K,V> builder(Map<K,V> backedMap)
Copyright © 2021. All rights reserved.