public class HttpMultiMap<V>
extends java.lang.Object
implements java.lang.Iterable<java.util.Map.Entry<java.lang.String,V>>
String
non-null keys. It stores keys
in case-sensitive way, but, by default, you can read them in case-insensitive
way.Modifier | Constructor and Description |
---|---|
protected |
HttpMultiMap(boolean caseSensitive) |
Modifier and Type | Method and Description |
---|---|
HttpMultiMap<V> |
add(java.lang.String name,
V value) |
HttpMultiMap<V> |
addAll(HttpMultiMap<V> map) |
HttpMultiMap<V> |
addAll(java.util.Map<java.lang.String,V> map) |
HttpMultiMap<V> |
addAll(java.lang.String name,
java.lang.Iterable<V> values) |
HttpMultiMap<V> |
clear()
Clears the map.
|
boolean |
contains(java.lang.String name)
Returns
true if name exist. |
java.util.List<java.util.Map.Entry<java.lang.String,V>> |
entries()
Returns all the entries of this map.
|
V |
get(java.lang.String name)
Returns the first value from the map associated with the name.
|
java.util.List<V> |
getAll(java.lang.String name)
Returns all values associated with the name.
|
java.util.Map.Entry<java.lang.String,V> |
getEntry(java.lang.String name)
Returns first entry for given name.
|
boolean |
isEmpty()
Returns
true if map is empty. |
java.util.Iterator<java.util.Map.Entry<java.lang.String,V>> |
iterator()
Returns iterator of all entries.
|
java.util.Set<java.lang.String> |
names() |
static <T> HttpMultiMap<T> |
newCaseInsensitiveMap()
Creates new case-insensitive multimap.
|
static <T> HttpMultiMap<T> |
newCaseSensitiveMap()
Creates new case-insensitive map.
|
HttpMultiMap<V> |
remove(java.lang.String name) |
HttpMultiMap<V> |
set(java.lang.String name,
V value) |
HttpMultiMap<V> |
setAll(HttpMultiMap<V> multiMap) |
HttpMultiMap<V> |
setAll(java.util.Map<java.lang.String,V> map) |
HttpMultiMap<V> |
setAll(java.lang.String name,
java.lang.Iterable<V> values) |
int |
size()
Returns the number of keys.
|
java.lang.String |
toString() |
public static <T> HttpMultiMap<T> newCaseInsensitiveMap()
public static <T> HttpMultiMap<T> newCaseSensitiveMap()
public int size()
public HttpMultiMap<V> clear()
public boolean contains(java.lang.String name)
true
if name exist.public boolean isEmpty()
true
if map is empty.public java.lang.String toString()
toString
in class java.lang.Object
public HttpMultiMap<V> setAll(HttpMultiMap<V> multiMap)
public HttpMultiMap<V> setAll(java.util.Map<java.lang.String,V> map)
public HttpMultiMap<V> set(java.lang.String name, V value)
public HttpMultiMap<V> setAll(java.lang.String name, java.lang.Iterable<V> values)
public HttpMultiMap<V> add(java.lang.String name, V value)
public HttpMultiMap<V> addAll(java.lang.String name, java.lang.Iterable<V> values)
public HttpMultiMap<V> addAll(HttpMultiMap<V> map)
public HttpMultiMap<V> addAll(java.util.Map<java.lang.String,V> map)
public HttpMultiMap<V> remove(java.lang.String name)
public V get(java.lang.String name)
null
if name does not exist or
if associated value is null
.public java.util.Map.Entry<java.lang.String,V> getEntry(java.lang.String name)
null
if entry
does not exist.public java.util.List<V> getAll(java.lang.String name)
public java.util.Iterator<java.util.Map.Entry<java.lang.String,V>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,V>>
public java.util.Set<java.lang.String> names()
public java.util.List<java.util.Map.Entry<java.lang.String,V>> entries()
Copyright © 2003-present Jodd Team