public class QueryParameters extends Object
key1=value1&key2=value2...
Modifier and Type | Field and Description |
---|---|
private Map<String,List<String>> |
parameters |
Modifier | Constructor and Description |
---|---|
private |
QueryParameters(String query) |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getKeys()
Get all keys that are present in the query string.
|
int |
getNumValues(String key)
Get the number of values for a key.
|
String |
getValue(String key)
Get the (single) value for a key.
|
List<String> |
getValues(String key)
Get all values for a key.
|
static QueryParameters |
parseQueryString(String query)
Parses a string in HTTP query format (
key1=value1&key2=value2... |
private QueryParameters(String query)
public static QueryParameters parseQueryString(String query)
key1=value1&key2=value2...
)
and returns it as a QueryParameters object.query
- The string to parseQueryParameters
objectpublic String getValue(String key)
key
- The keypublic List<String> getValues(String key)
public int getNumValues(String key)
key
- The key