org.glassfish.jersey.internal.util.collection
Class MultivaluedStringMap

java.lang.Object
  extended by javax.ws.rs.core.AbstractMultivaluedMap<K,V>
      extended by javax.ws.rs.core.MultivaluedHashMap<String,String>
          extended by org.glassfish.jersey.internal.util.collection.MultivaluedStringMap
All Implemented Interfaces:
Serializable, Map<String,List<String>>, MultivaluedMap<String,String>

public class MultivaluedStringMap
extends MultivaluedHashMap<String,String>

An implementation of MultivaluedMap where keys and values are instances of String.

This map has an additional ability to instantiate classes using the individual string values as a constructor parameters.

Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class javax.ws.rs.core.AbstractMultivaluedMap
store
 
Constructor Summary
MultivaluedStringMap()
           
MultivaluedStringMap(int initialCapacity)
           
MultivaluedStringMap(int initialCapacity, float loadFactor)
           
MultivaluedStringMap(MultivaluedMap<? extends String,? extends String> map)
           
 
Method Summary
protected  void addFirstNull(List<String> values)
          Define the behavior for adding a null values to the first position in the value list.
protected  void addNull(List<String> values)
          Define the behavior for adding a null values to the value list.
<A> A
getFirst(String key, A defaultValue)
           
<A> A
getFirst(String key, Class<A> type)
           
 
Methods inherited from class javax.ws.rs.core.AbstractMultivaluedMap
add, addAll, addAll, addFirst, clear, containsKey, containsValue, entrySet, equals, equalsIgnoreValueOrder, get, getFirst, getValues, hashCode, isEmpty, keySet, put, putAll, putSingle, remove, size, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultivaluedStringMap

public MultivaluedStringMap(MultivaluedMap<? extends String,? extends String> map)

MultivaluedStringMap

public MultivaluedStringMap(int initialCapacity,
                            float loadFactor)

MultivaluedStringMap

public MultivaluedStringMap(int initialCapacity)

MultivaluedStringMap

public MultivaluedStringMap()
Method Detail

addFirstNull

protected void addFirstNull(List<String> values)
Description copied from class: AbstractMultivaluedMap
Define the behavior for adding a null values to the first position in the value list.

Default implementation is a no-op, i.e. the null values are ignored. Overriding implementations may modify this behavior by providing their own definitions of this method.

Overrides:
addFirstNull in class AbstractMultivaluedMap<String,String>
Parameters:
values - value list where the null value addition is being requested.

addNull

protected void addNull(List<String> values)
Description copied from class: AbstractMultivaluedMap
Define the behavior for adding a null values to the value list.

Default implementation is a no-op, i.e. the null values are ignored. Overriding implementations may modify this behavior by providing their own definitions of this method.

Overrides:
addNull in class AbstractMultivaluedMap<String,String>
Parameters:
values - value list where the null value addition is being requested.

getFirst

public final <A> A getFirst(String key,
                            Class<A> type)

getFirst

public final <A> A getFirst(String key,
                            A defaultValue)


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.