public class NullAllowingImmutableMap<K,V> extends AbstractMap<K,V> implements Serializable
This implementation is intended for low cardinalities, query operations have linear performance. Insertion order is preserved.
| Modifier and Type | Class and Description |
|---|---|
static class |
NullAllowingImmutableMap.Builder<K,V>
A builder to create an immutable map; this class is not thread-safe.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
static <K,V> NullAllowingImmutableMap.Builder<K,V> |
builder()
Returns a builder to create a new instance, with the default expected size (16).
|
static <K,V> NullAllowingImmutableMap.Builder<K,V> |
builder(int expectedSize)
Returns a builder to create a new instance.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> NullAllowingImmutableMap<K,V> |
copyOf(Map<K,V> map) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
static <K,V> NullAllowingImmutableMap<K,V> |
of() |
static <K,V> NullAllowingImmutableMap<K,V> |
of(K key1,
V value1) |
static <K,V> NullAllowingImmutableMap<K,V> |
of(K key1,
V value1,
K key2,
V value2) |
static <K,V> NullAllowingImmutableMap<K,V> |
of(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
clear, clone, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic static <K,V> NullAllowingImmutableMap<K,V> of()
public static <K,V> NullAllowingImmutableMap<K,V> of(K key1, V value1)
public static <K,V> NullAllowingImmutableMap<K,V> of(K key1, V value1, K key2, V value2)
public static <K,V> NullAllowingImmutableMap<K,V> of(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> NullAllowingImmutableMap<K,V> copyOf(Map<K,V> map)
public static <K,V> NullAllowingImmutableMap.Builder<K,V> builder()
builder(int)public static <K,V> NullAllowingImmutableMap.Builder<K,V> builder(int expectedSize)
expectedSize - the number of expected entries in the map. This is used to pre-size
internal data structures (if the builder ends up having more entries, it resizes
automatically).public boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in class AbstractMap<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>Copyright © 2017–2022. All rights reserved.