Spring Social

org.springframework.social.support
Class ParameterMap

java.lang.Object
  extended by org.springframework.social.support.ParameterMap
All Implemented Interfaces:
java.util.Map<java.lang.String,java.util.List<java.lang.String>>, org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>
Direct Known Subclasses:
OAuth1Parameters, OAuth2Parameters

public class ParameterMap
extends java.lang.Object
implements org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

Generally useful base class for creating MultiValueMaps that store HTTP query parameters. May be subclassed to add specific getter/setter methods for known parameters used in a specific context. Also makes it easy to adapt a Map<String, List<String>> to an MultiValueMap<String, String>.

Author:
Craig Walls

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
protected ParameterMap()
          Creates a new MultiValueMap<String, String> that is initially empty.
protected ParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
          Wraps the provided Map<String, List<String>> as a MultiValueMap<String, String>.
 
Method Summary
 void add(java.lang.String key, java.lang.String value)
           
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> entrySet()
           
 java.util.List<java.lang.String> get(java.lang.Object key)
           
 java.lang.String getFirst(java.lang.String key)
           
 boolean isEmpty()
           
 java.util.Set<java.lang.String> keySet()
           
 java.util.List<java.lang.String> put(java.lang.String key, java.util.List<java.lang.String> values)
           
 void putAll(java.util.Map<? extends java.lang.String,? extends java.util.List<java.lang.String>> map)
           
 java.util.List<java.lang.String> remove(java.lang.Object key)
           
 void set(java.lang.String key, java.lang.String value)
           
 void setAll(java.util.Map<java.lang.String,java.lang.String> values)
           
 int size()
           
 java.util.Map<java.lang.String,java.lang.String> toSingleValueMap()
           
 java.util.Collection<java.util.List<java.lang.String>> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ParameterMap

protected ParameterMap()
Creates a new MultiValueMap<String, String> that is initially empty.


ParameterMap

protected ParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
Wraps the provided Map<String, List<String>> as a MultiValueMap<String, String>. The map passed in is stored internally. No copy is created.

Method Detail

clear

public void clear()
Specified by:
clear in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

entrySet

public java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>> entrySet()
Specified by:
entrySet in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

get

public java.util.List<java.lang.String> get(java.lang.Object key)
Specified by:
get in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

keySet

public java.util.Set<java.lang.String> keySet()
Specified by:
keySet in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

put

public java.util.List<java.lang.String> put(java.lang.String key,
                                            java.util.List<java.lang.String> values)
Specified by:
put in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

putAll

public void putAll(java.util.Map<? extends java.lang.String,? extends java.util.List<java.lang.String>> map)
Specified by:
putAll in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

remove

public java.util.List<java.lang.String> remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

size

public int size()
Specified by:
size in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

values

public java.util.Collection<java.util.List<java.lang.String>> values()
Specified by:
values in interface java.util.Map<java.lang.String,java.util.List<java.lang.String>>

getFirst

public java.lang.String getFirst(java.lang.String key)
Specified by:
getFirst in interface org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

add

public void add(java.lang.String key,
                java.lang.String value)
Specified by:
add in interface org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

set

public void set(java.lang.String key,
                java.lang.String value)
Specified by:
set in interface org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

setAll

public void setAll(java.util.Map<java.lang.String,java.lang.String> values)
Specified by:
setAll in interface org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

toSingleValueMap

public java.util.Map<java.lang.String,java.lang.String> toSingleValueMap()
Specified by:
toSingleValueMap in interface org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>

Spring Social