Map whose contents will never change, with many other important properties detailed at
ImmutableCollection.
See the Guava User Guide article on immutable collections.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ImmutableMap.Builder<K, V>
A builder for creating immutable map instances, especially |
| pack-priv abstract static class | |
| private class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Map. | |
| private transient ImmutableSet | |
| private transient ImmutableSet | |
| private transient ImmutableSetMultimap | |
| private transient ImmutableCollection |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public ImmutableSetMultimap | |
| public static <K, V> ImmutableMap. | |
| public static <K, V> ImmutableMap. | builderWithExpectedSize(int expectedSize)
Returns a new builder, expecting the specified number of entries to be added. |
| pack-priv static void | |
| public final void | clear()
Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final V | compute(K
key with which the specified value is to be associated key, BiFunction<? super K, ? super @Nullable V, ? extends V> the remapping function to compute a value remappingFunction)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final V | computeIfAbsent(K
key with which the specified value is to be associated key, Function<? super K, ? extends V> the mapping function to compute a value mappingFunction)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final V | computeIfPresent(K
key with which the specified value is to be associated key, BiFunction<? super K, ? super V, ? extends V> the remapping function to compute a value remappingFunction)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| pack-priv static IllegalArgumentException | |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| public static <K, V> ImmutableMap | copyOf(Map<? extends K, ? extends V>
a map)Map from which entries are drawn, must be non-nullHides java. map.
|
| public static <K, V> ImmutableMap | |
| private static <K extends Enum | |
| pack-priv abstract ImmutableSet | |
| pack-priv abstract ImmutableSet | |
| pack-priv abstract ImmutableCollection | |
| pack-priv static <K, V> Map. | entryOf(K key, V value)
Verifies that |
| public ImmutableSet | |
| public boolean | equals(Object
object to be compared for equality with this map object)Overrides java. Implements java. |
| public abstract V | get(Object
the key whose associated value is to be returned key)Redeclares java. null if this map contains no mapping for the key.
|
| public final V | getOrDefault(Object
the key whose associated value is to be returned key, V the default mapping of the key defaultValue)Overrides default java. defaultValue if this map contains no mapping for the key.
|
| public int | hashCode()
Overrides java. Implements java. |
| public boolean | |
| pack-priv boolean | |
| pack-priv abstract boolean | |
| pack-priv UnmodifiableIterator | |
| public ImmutableSet | keySet()
Implements java. entrySet.
|
| pack-priv Spliterator | |
| public final V | merge(K
key with which the resulting value is to be associated key, V the non-null value to be merged with the existing value
associated with the key or, if no existing value or a null value
is associated with the key, to be associated with the key value, BiFunction<? super V, ? super V, ? extends @Nullable V> the remapping function to recompute a value if
present function)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public static <K, V> ImmutableMap | |
| public static <K, V> ImmutableMap | of(K
the mapping's key k1, V the mapping's value v1)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5, K the sixth mapping's key k6, V the sixth mapping's value v6)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5, K the sixth mapping's key k6, V the sixth mapping's value v6, K the seventh mapping's key k7, V the seventh mapping's value v7)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5, K the sixth mapping's key k6, V the sixth mapping's value v6, K the seventh mapping's key k7, V the seventh mapping's value v7, K the eighth mapping's key k8, V the eighth mapping's value v8)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5, K the sixth mapping's key k6, V the sixth mapping's value v6, K the seventh mapping's key k7, V the seventh mapping's value v7, K the eighth mapping's key k8, V the eighth mapping's value v8, K the ninth mapping's key k9, V the ninth mapping's value v9)Hides java. |
| public static <K, V> ImmutableMap | of(K
the first mapping's key k1, V the first mapping's value v1, K the second mapping's key k2, V the second mapping's value v2, K the third mapping's key k3, V the third mapping's value v3, K the fourth mapping's key k4, V the fourth mapping's value v4, K the fifth mapping's key k5, V the fifth mapping's value v5, K the sixth mapping's key k6, V the sixth mapping's value v6, K the seventh mapping's key k7, V the seventh mapping's value v7, K the eighth mapping's key k8, V the eighth mapping's value v8, K the ninth mapping's key k9, V the ninth mapping's value v9, K the tenth mapping's key k10, V the tenth mapping's value v10)Hides java. |
| public static <K, V> ImmutableMap | ofEntries(Map.
Map.Entrys containing the keys and values from which the map is populatedHides java. |
| public final V | put(K
key with which the specified value is to be associated k, V value to be associated with the specified key v)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final void | putAll(Map<? extends K, ? extends V>
mappings to be stored in this map map)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final V | putIfAbsent(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| private void | |
| public final V | remove(Object
key whose mapping is to be removed from the map o)Implements java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final boolean | remove(Object
key with which the specified value is associated key, Object value expected to be associated with the specified key value)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final boolean | replace(K
key with which the specified value is associated key, V value expected to be associated with the specified key oldValue, V value to be associated with the specified key newValue)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final V | replace(K
key with which the specified value is associated key, V value to be associated with the specified key value)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public final void | replaceAll(BiFunction<? super K, ? super V, ? extends V>
the function to apply to each entry function)Overrides default java.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the map unmodified.
|
| public static <T extends @Nullable Object, K, V> Collector | toImmutableMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)
Returns a |
| public static <T extends @Nullable Object, K, V> Collector | toImmutableMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction, BinaryOperator<V> mergeFunction)
Returns a |
| public String | |
| public ImmutableCollection | values()
Implements java. entrySet.
|
| pack-priv Object |