Package aQute.libg.map
Class BuilderMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- aQute.libg.map.BuilderMap<K,V>
-
- Type Parameters:
K
- the key typeV
- the value type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,V>
public class BuilderMap<K,V> extends java.util.HashMap<K,V>
A map that is to set inline like a builder. I.e. you can do `new LiteralMap<>().set("a", a).set("b",b)`.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BuilderMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
BuilderMap<K,V>map(K key, V value)
BuilderMap<K,V>
set(K key, V value)
BuilderMap<K,V>
setAll(java.util.Map<K,V> src)
BuilderMap<K,V>
setIfAbsent(K key, V value)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
set
public BuilderMap<K,V> set(K key, V value)
-
setAll
public BuilderMap<K,V> setAll(java.util.Map<K,V> src)
-
setIfAbsent
public BuilderMap<K,V> setIfAbsent(K key, V value)
-
map
public static <K,V> BuilderMap<K,V> map(K key, V value)
-
-