K
- Class of the key for the map.V
- Class of the value for the map.public class ImmutableMapParameter<K,V> extends Object implements Map<K,V>
Example of using map Builder:
{ @code Map<String, AttributeValue> item = new ImmutableMapParameter.Builder<String, AttributeValue>() .put("one", new AttributeValue("1")) .put("two", new AttributeValue("2")) .put("three", new AttributeValue("3")).build(); }For small immutable maps (up to five entries), the
ImmutableMapParamter.of()
methods are preferred:
Map<String, AttributeValue> item =
ImmutableMapParameter
.of("one", new AttributeValue("1"),
"two", new AttributeValue("2"),
"three", new AttributeValue("3"),
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableMapParameter.Builder<K,V>
A convenient builder for creating ImmutableMapParameter instances.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> ImmutableMapParameter.Builder<K,V> |
builder()
Returns a new MapParameterBuilder instance.
|
void |
clear()
Unsupported methods
|
boolean |
containsKey(Object key)
Inherited methods
|
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
static <K,V> ImmutableMapParameter<K,V> |
of(K k0,
V v0)
Returns an ImmutableMapParameter instance containing a single entry.
|
static <K,V> ImmutableMapParameter<K,V> |
of(K k0,
V v0,
K k1,
V v1)
Returns an ImmutableMapParameter instance containing two entries.
|
static <K,V> ImmutableMapParameter<K,V> |
of(K k0,
V v0,
K k1,
V v1,
K k2,
V v2)
Returns an ImmutableMapParameter instance containing three entries.
|
static <K,V> ImmutableMapParameter<K,V> |
of(K k0,
V v0,
K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
Returns an ImmutableMapParameter instance containing four entries.
|
static <K,V> ImmutableMapParameter<K,V> |
of(K k0,
V v0,
K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
Returns an ImmutableMapParameter instance containing five entries.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static <K,V> ImmutableMapParameter.Builder<K,V> builder()
public static <K,V> ImmutableMapParameter<K,V> of(K k0, V v0)
k0
- Key of the single entry.v0
- Value of the single entry.public static <K,V> ImmutableMapParameter<K,V> of(K k0, V v0, K k1, V v1)
k0
- Key of the first entry.v0
- Value of the first entry.k1
- Key of the second entry.v1
- Value of the second entry.public static <K,V> ImmutableMapParameter<K,V> of(K k0, V v0, K k1, V v1, K k2, V v2)
k0
- Key of the first entry.v0
- Value of the first entry.k1
- Key of the second entry.v1
- Value of the second entry.k2
- Key of the third entry.v2
- Value of the third entry.public static <K,V> ImmutableMapParameter<K,V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3)
k0
- Key of the first entry.v0
- Value of the first entry.k1
- Key of the second entry.v1
- Value of the second entry.k2
- Key of the third entry.v2
- Value of the third entry.k3
- Key of the fourth entry.v3
- Value of the fourth entry.public static <K,V> ImmutableMapParameter<K,V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
k0
- Key of the first entry.v0
- Value of the first entry.k1
- Key of the second entry.v1
- Value of the second entry.k2
- Key of the third entry.v2
- Value of the third entry.k3
- Key of the fourth entry.v3
- Value of the fourth entry.k4
- Key of the fifth entry.v4
- Value of the fifth entry.public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public boolean equals(Object o)
public int hashCode()
Copyright © 2024. All rights reserved.