Interface UriQuery
- All Superinterfaces:
Parameters
- All Known Subinterfaces:
UriQueryWriteable
HTTP Query representation.
Query is the section separated by
? character from the path, where each query parameter is separated
by & character.-
Nested Class Summary
Nested classes/interfaces inherited from interface Parameters
Parameters.Builder -
Field Summary
Fields inherited from interface Parameters
GENERIC_TYPEModifier and TypeFieldDescriptionstatic final GenericType<Parameters> Generic type for parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic UriQueryCreate a new HTTP query from the query string.static UriQueryCreate a new HTTP query from the query string, validating if requested.static UriQueryCreate URI query from a URI instance.static UriQueryempty()Create an empty HTTP query.Get all raw values (undecoded) of a query parameter by its name.Get raw value (undecoded) of a query parameter by its name.rawValue()Query fully encoded, without the leading?character.value()Query NOT encoded without the leading?character.Methods inherited from interface Parameters
all, all, allValues, allValues, component, contains, first, get, isEmpty, names, size, toMapModifier and TypeMethodDescriptionGet all values.Get all values using a default value supplier if the parameter does not exist.A list of values for the named parameter.Get all values using a default value supplier if the parameter does not exist.Name of the component of these parameters.booleanWhether these parameters contain the provided name.Get the first value as an optional.Get the first value.default booleanisEmpty()Whether these parameters are empty.names()Set of parameter names.intsize()Number of parameter names in these parameters.toMap()Get a map representation of these parameters.
-
Method Details
-
create
Create a new HTTP query from the query string. This method does not validate the raw query against specification. Malformed percent-encoded sequences are preserved literally when parameter names and values are decoded. Usecreate(query, true)for strict query validation.- Parameters:
query- raw query string- Returns:
- HTTP query instance
- See Also:
-
create
-
empty
-
create
Create URI query from a URI instance.- Parameters:
uri- URI to use as the source of this query- Returns:
- HTTP query instance either empty (if query section of the provided URI is
null) orcreate(String)with the raw query
-
rawValue
String rawValue()Query fully encoded, without the leading?character.- Returns:
- raw query to be sent (or that was received) over the wire
-
value
String value()Query NOT encoded without the leading?character.- Returns:
- query to be sent (or that was received) over the wire but decoded
-
getRaw
Get raw value (undecoded) of a query parameter by its name.- Parameters:
name- query parameter name- Returns:
- value of the parameter, raw
- Throws:
NoSuchElementException- in case the parameter does not exist
-
getAllRaw
Get all raw values (undecoded) of a query parameter by its name.- Parameters:
name- query parameter name- Returns:
- values of the parameter, raw
- Throws:
NoSuchElementException- in case the parameter does not exist
-