Interface UriQueryWriteable
- All Superinterfaces:
Parameters, UriQuery
Mutable HTTP query.
-
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 TypeMethodDescriptionAdd a new query parameter or add a value to existing.voidclear()Clear all query parameters.static UriQueryWriteablecreate()Create a new HTTP Query to write parameter into.Update this query by copying all names and their value(s) from the provided query.voidfromQueryString(String queryString) Update from a query string (with encoded values).Remove a query parameter.Remove a query parameter.Set a query parameter with values.setIfAbsent(String name, String... value) Set a query parameter with values, if not already defined.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.Methods inherited from interface UriQuery
getAllRaw, getRaw, rawValue, value
-
Method Details
-
create
Create a new HTTP Query to write parameter into.- Returns:
- new mutable HTTP query
-
from
Update this query by copying all names and their value(s) from the provided query.- Parameters:
uriQuery- uri query to read- Returns:
- updated instance
-
set
Set a query parameter with values.- Parameters:
name- name of the parametervalue- value(s) of the parameter- Returns:
- this instance
-
add
Add a new query parameter or add a value to existing.- Parameters:
name- name of the parametervalue- additional value of the parameter- Returns:
- this instance
-
setIfAbsent
Set a query parameter with values, if not already defined.- Parameters:
name- name of the parametervalue- value(s) of the parameter- Returns:
- this instance
-
remove
Remove a query parameter.- Parameters:
name- name of the parameter- Returns:
- this instance
-
remove
Remove a query parameter.- Parameters:
name- name of the parameterremovedConsumer- consumer of existing values, only called if there was an existing value- Returns:
- this instance
-
fromQueryString
Update from a query string (with encoded values).This documentation (and behavior) has been changed, as we cannot create a proper query from
decodedvalues, as these may contain characters used to split the query. Malformed percent-encoded sequences are preserved literally when parameter names and values are decoded. UseUriValidator.validateQuery(String)for strict query validation before updating this instance.- Parameters:
queryString- encoded query string to update this instance
-
clear
void clear()Clear all query parameters.
-