K - The key type of the map.V - The value type of the map.public class MapBuilder<K,V> extends Object implements Map<K,V>
Map via delegation for convenience so you don't have to
actually build() it.| Constructor and Description |
|---|
MapBuilder()
Create a new
MapBuilder. |
MapBuilder(Map<K,V> source)
Create a new instance with a copy of the given map.
|
| Modifier and Type | Method and Description |
|---|---|
Map<K,V> |
build()
Return a new map based on the current state of this builder's map.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
MapBuilder<K,V> |
entry(K key,
V value)
Add an entry to this map, then returns
this. |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
static MapBuilder<Object,Object> |
map()
Factory method to construct a new
MapBuilder<Object,Object>. |
static <K,V> MapBuilder<K,V> |
map(Class<K> keyType,
Class<V> valueType)
Factory method to construct a new builder with the given key & value types.
|
static <K,V> MapBuilder<K,V> |
map(Map<K,V> source)
Factory method to construct a new builder with a shallow copy of the given map.
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic MapBuilder()
MapBuilder.public static MapBuilder<Object,Object> map()
MapBuilder<Object,Object>. Convenient if imported statically.public static <K,V> MapBuilder<K,V> map(Class<K> keyType, Class<V> valueType)
public static <K,V> MapBuilder<K,V> map(Map<K,V> source)
public MapBuilder<K,V> entry(K key, V value)
this.public Map<K,V> build()
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)
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.