K - the type of the Map's keys.V - the type of the Map's values.public static final class ImmutableMap.Builder<K,V> extends Object
ImmutableMap builder. Not thread-safe.| Constructor and Description |
|---|
ImmutableMap.Builder() |
| Modifier and Type | Method and Description |
|---|---|
Map<K,V> |
build()
Finalizes the creation of the
ImmutableMap. |
ImmutableMap.Builder<K,V> |
put(K key,
V value)
Associates the specified value with the specified key in the
Map being built. |
ImmutableMap.Builder<K,V> |
put(Map<? extends K,? extends V> map)
Copies all of the mappings from the specified
Map to
the Map being built. |
public ImmutableMap.Builder<K,V> put(K key, V value)
Map being built.key - the key.value - the value.public ImmutableMap.Builder<K,V> put(Map<? extends K,? extends V> map)
Map to
the Map being built.map - mappings to be copied.NullPointerException - if map is null.Copyright © 2012–2015. All rights reserved.