com.sun.jersey.core.util
Class MultivaluedMapImpl
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,List<String>>
com.sun.jersey.core.util.MultivaluedMapImpl
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,List<String>>, MultivaluedMap<String,String>
- Direct Known Subclasses:
- Form
public class MultivaluedMapImpl
- extends HashMap<String,List<String>>
- implements MultivaluedMap<String,String>
An implementation of MultivaluedMap
where keys and values are
instances of String.
- Author:
- Paul.Sandoz@Sun.Com
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
MultivaluedMapImpl
public MultivaluedMapImpl()
MultivaluedMapImpl
public MultivaluedMapImpl(MultivaluedMap<String,String> that)
putSingle
public final void putSingle(String key,
String value)
- Description copied from interface:
MultivaluedMap
- Set the key's value to be a one item list consisting of the supplied value.
Any existing values will be replaced.
- Specified by:
putSingle
in interface MultivaluedMap<String,String>
- Parameters:
key
- the keyvalue
- the single value of the key
add
public final void add(String key,
String value)
- Description copied from interface:
MultivaluedMap
- Add a value to the current list of values for the supplied key.
- Specified by:
add
in interface MultivaluedMap<String,String>
- Parameters:
key
- the keyvalue
- the value to be added.
getFirst
public final String getFirst(String key)
- Description copied from interface:
MultivaluedMap
- A shortcut to get the first value of the supplied key.
- Specified by:
getFirst
in interface MultivaluedMap<String,String>
- Parameters:
key
- the key
- Returns:
- the first value for the specified key or null if the key is
not in the map.
addFirst
public final void addFirst(String key,
String value)
get
public final <A> List<A> get(String key,
Class<A> type)
putSingle
public final void putSingle(String key,
Object value)
add
public final void add(String key,
Object value)
getFirst
public final <A> A getFirst(String key,
Class<A> type)
getFirst
public final <A> A getFirst(String key,
A defaultValue)
Copyright © 2013 Oracle Corporation. All Rights Reserved.