Package net.sf.basedb.util
Class QueryParameters
java.lang.Object
net.sf.basedb.util.QueryParameters
Utiltity class for parsing string values in the form of
HTTP request query parameters:
key1=value1&key2=value2...
- Version:
- 2.6
- Author:
- nicklas
- Last modified
- $Date: 2015-05-12 11:27:08 +0200 (ti, 12 maj 2015) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKeys()
Get all keys that are present in the query string.int
getNumValues
(String key) Get the number of values for a key.Get the (single) value for a key.Get all values for a key.static QueryParameters
parseQueryString
(String query) Parses a string in HTTP query format (key1=value1&key2=value2...
) and returns it as a QueryParameters object.
-
Field Details
-
parameters
-
-
Constructor Details
-
QueryParameters
-
-
Method Details
-
parseQueryString
Parses a string in HTTP query format (key1=value1&key2=value2...
) and returns it as a QueryParameters object.- Parameters:
query
- The string to parse- Returns:
- A
QueryParameters
object
-
getValue
Get the (single) value for a key. If the query string contained more than one value for this key, the first value is returned.- Parameters:
key
- The key- Returns:
- The value, or null if no value was found for the key
-
getValues
Get all values for a key.- Returns:
- A list of values, or null if no value was found for the key
-
getNumValues
Get the number of values for a key.- Parameters:
key
- The key- Returns:
- The number of values
-
getKeys
Get all keys that are present in the query string.- Returns:
- A set with the keys
-