|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oauth.signpost.http.HttpParameters
public class HttpParameters
A multi-map of HTTP request parameters. Each key references a
SortedSet
of parameters collected from the request during message
signing. Parameter values are sorted as per ://oauth.net/core/1.0a/#anchor13. Every key/value pair will be
percent-encoded upon insertion. This class has special semantics tailored to
being useful for message signing; it's not a general purpose collection class
to handle request parameters.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
HttpParameters()
|
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<String,SortedSet<String>>> |
entrySet()
|
SortedSet<String> |
get(Object key)
|
String |
getAsHeaderElement(String key)
|
String |
getAsQueryString(Object key)
Concatenates all values for the given key to a list of key/value pairs suitable for use in a URL query string. |
String |
getFirst(Object key)
Convenience method for #getFirst(key, false) . |
String |
getFirst(Object key,
boolean percentDecode)
Returns the first value from the set of all values for the given parameter name. |
boolean |
isEmpty()
|
Set<String> |
keySet()
|
SortedSet<String> |
put(String key,
SortedSet<String> value)
|
SortedSet<String> |
put(String key,
SortedSet<String> values,
boolean percentEncode)
|
String |
put(String key,
String value)
Convenience method to add a single value for the parameter specified by 'key'. |
String |
put(String key,
String value,
boolean percentEncode)
Convenience method to add a single value for the parameter specified by 'key'. |
void |
putAll(Map<? extends String,? extends SortedSet<String>> m)
|
void |
putAll(Map<? extends String,? extends SortedSet<String>> m,
boolean percentEncode)
|
void |
putAll(String[] keyValuePairs,
boolean percentEncode)
|
void |
putMap(Map<String,List<String>> m)
Convenience method to merge a Map |
String |
putNull(String key,
String nullString)
Convenience method to allow for storing null values. |
SortedSet<String> |
remove(Object key)
|
int |
size()
|
Collection<SortedSet<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 |
---|
public HttpParameters()
Method Detail |
---|
public SortedSet<String> put(String key, SortedSet<String> value)
put
in interface Map<String,SortedSet<String>>
public SortedSet<String> put(String key, SortedSet<String> values, boolean percentEncode)
public String put(String key, String value)
key
- the parameter namevalue
- the parameter value
public String put(String key, String value, boolean percentEncode)
key
- the parameter namevalue
- the parameter valuepercentEncode
- whether key and value should be percent encoded before being
inserted into the map
public String putNull(String key, String nullString)
put(java.lang.String, java.util.SortedSet)
doesn't
allow null values, because that would be ambiguous.
key
- the parameter namenullString
- can be anything, but probably... null?
public void putAll(Map<? extends String,? extends SortedSet<String>> m)
putAll
in interface Map<String,SortedSet<String>>
public void putAll(Map<? extends String,? extends SortedSet<String>> m, boolean percentEncode)
public void putAll(String[] keyValuePairs, boolean percentEncode)
public void putMap(Map<String,List<String>> m)
m
- the mappublic SortedSet<String> get(Object key)
get
in interface Map<String,SortedSet<String>>
public String getFirst(Object key)
#getFirst(key, false)
.
key
- the parameter name (must be percent encoded if it contains unsafe
characters!)
public String getFirst(Object key, boolean percentDecode)
OAuth.percentEncode(String)
, otherwise the lookup will fail
(that's because upon storing values in this map, keys get
percent-encoded).
key
- the parameter name (must be percent encoded if it contains unsafe
characters!)percentDecode
- whether the value being retrieved should be percent decoded
public String getAsQueryString(Object key)
key
- the parameter name
public String getAsHeaderElement(String key)
public boolean containsKey(Object key)
containsKey
in interface Map<String,SortedSet<String>>
public boolean containsValue(Object value)
containsValue
in interface Map<String,SortedSet<String>>
public int size()
size
in interface Map<String,SortedSet<String>>
public boolean isEmpty()
isEmpty
in interface Map<String,SortedSet<String>>
public void clear()
clear
in interface Map<String,SortedSet<String>>
public SortedSet<String> remove(Object key)
remove
in interface Map<String,SortedSet<String>>
public Set<String> keySet()
keySet
in interface Map<String,SortedSet<String>>
public Collection<SortedSet<String>> values()
values
in interface Map<String,SortedSet<String>>
public Set<Map.Entry<String,SortedSet<String>>> entrySet()
entrySet
in interface Map<String,SortedSet<String>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |