K - map key typeV - map value typepublic final class MapBuilder<K,V> extends Object
Map.
Underlying implementation uses a HashMap, but disallows null keys, null values, and duplicate keys. This is consistent with Java 9 Map.of() static factory
method, which will eventually replace the uses of this utility.
| Constructor and Description |
|---|
MapBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Map<K,V> |
build() |
Map<K,V> |
buildModifiable() |
MapBuilder<K,V> |
put(K key,
V value)
Adds a unique non-null key/value pair.
|
Copyright © 2024. All rights reserved.