K
- the key type.V
- the value type (i.e. the values stored in the collections).public class ListMap<K,V> extends CollectionMap<K,V,java.util.List<V>>
Constructor and Description |
---|
ListMap()
Create new hashed list map.
|
ListMap(ListMap<K,V> other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addIfNotNull(K key,
V value)
Adds the value only if the key and value are not null
|
protected java.util.List<V> |
createNewCollection()
Returns a new instance of the underlying collection to be used as value for
the underlaying map.
|
static <K,V> ListMap<K,V> |
of(K key,
java.util.Collection<? extends V> values)
Creates a new ListMap of the given key/values.
|
static ListMap<java.lang.String,java.lang.String> |
of(java.lang.String... keysAndValues)
Creates a list map from a string array provided it's length is even
|
add, addAll, addAll, addAll, clear, collectionsToArrays, contains, containsCollection, createUnderlyingMap, createWithCollectionSupplier, getCollection, getCollectionOrElse, getCollectionOrEmpty, getKeys, getValueCount, getValues, iterator, remove, removeCollection, size, toString
public ListMap()
public boolean addIfNotNull(K key, V value)
public static ListMap<java.lang.String,java.lang.String> of(java.lang.String... keysAndValues)
public static <K,V> ListMap<K,V> of(K key, java.util.Collection<? extends V> values)
protected java.util.List<V> createNewCollection()
createNewCollection
in class CollectionMap<K,V,java.util.List<V>>