public interface MultiMap<V>
extends java.lang.Iterable<java.util.Map.Entry<java.lang.String,V>>
| Modifier and Type | Method and Description |
|---|---|
MultiMap<V> |
add(java.lang.String name,
V value)
Adds a new value with the specified name and value.
|
MultiMap<V> |
addAll(java.util.Map<java.lang.String,V> map)
Adds all values from the map.
|
MultiMap<V> |
addAll(java.lang.String name,
java.lang.Iterable<V> values)
Adds new values under the specified name.
|
MultiMap<V> |
clear()
Removes all values.
|
boolean |
contains(java.lang.String name)
Checks to see if there is a value with the specified name.
|
java.util.List<java.util.Map.Entry<java.lang.String,V>> |
entries()
Returns all entries in the multi-map.
|
V |
get(java.lang.String name)
Get the String value associated with a key.
|
java.util.List<V> |
getAll(java.lang.String name)
Returns the values with the specified name.
|
boolean |
isCaseSensitive()
Returns
true if this map is case sensitive. |
boolean |
isEmpty()
Returns
true if empty. |
java.util.Set<java.lang.String> |
names()
Gets a immutable
Set of all names |
static <T> MultiMap<T> |
newCaseSensitiveMultiMap()
Creates new case-sensitive implementation of the multi-map.
|
static <T> MultiMap<T> |
newMultiMap()
Creates new default implementation of the multi-map.
|
MultiMap<V> |
remove(java.lang.String name)
Removes the value with the given name
|
MultiMap<V> |
set(java.lang.String name,
V value)
Sets a value under the specified name.
|
MultiMap<V> |
setAll(java.util.Map<java.lang.String,V> map)
Sets values from given map.
|
MultiMap<V> |
setAll(java.lang.String name,
java.lang.Iterable<V> values)
Sets values for the specified name.
|
int |
size()
Return the number of keys.
|
static <T> MultiMap<T> newCaseSensitiveMultiMap()
static <T> MultiMap<T> newMultiMap()
MultiMap<V> add(java.lang.String name, V value)
name - The namevalue - The value being addedMultiMap<V> addAll(java.util.Map<java.lang.String,V> map)
map - source mapMultiMap<V> addAll(java.lang.String name, java.lang.Iterable<V> values)
name - The name being setvalues - The valuesMultiMap<V> clear()
boolean contains(java.lang.String name)
name - The name to search forjava.util.List<java.util.Map.Entry<java.lang.String,V>> entries()
List of the name-value entries, which will be
empty if no pairs are foundV get(java.lang.String name)
java.util.List<V> getAll(java.lang.String name)
name - The name to searchList of values which will be empty
if no values are foundboolean isCaseSensitive()
true if this map is case sensitive.boolean isEmpty()
true if empty.java.util.Set<java.lang.String> names()
Set of all namesSet of all namesMultiMap<V> remove(java.lang.String name)
name - The name of the value to removeMultiMap<V> set(java.lang.String name, V value)
If there is an existing key with the same name, it is removed.
name - The namevalue - The valueMultiMap<V> setAll(java.util.Map<java.lang.String,V> map)
map - The source mapMultiMap<V> setAll(java.lang.String name, java.lang.Iterable<V> values)
name - The name being setvalues - The values being setint size()