public class DefaultMapBuilder<K,V> extends Object implements MapBuilder<K,V>
Constructor and Description |
---|
DefaultMapBuilder(String id) |
Modifier and Type | Method and Description |
---|---|
Map<K,V> |
build()
Returns a newly-created immutable map.
|
String |
getId() |
DefaultMapBuilder<K,V> |
put(K key,
V value)
Associates
key with value in the built map. |
DefaultMapBuilder<K,V> |
putAll(Map<? extends K,? extends V> map)
Associates all of the given map's keys and values in the built map.
|
public DefaultMapBuilder(String id)
public String getId()
getId
in interface MapBuilder<K,V>
public DefaultMapBuilder<K,V> put(K key, V value)
key
with value
in the built map.put
in interface MapBuilder<K,V>
key
- keyvalue
- valuepublic DefaultMapBuilder<K,V> putAll(Map<? extends K,? extends V> map)
putAll
in interface MapBuilder<K,V>
map
- Map to addNullPointerException
- if any key or value in map
is nullpublic Map<K,V> build()
IllegalArgumentException
- if duplicate keys were addedCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.