Interface UriQueryWriteable
- All Superinterfaces:
Parameters, UriQuery
Mutable HTTP query.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Parameters
Parameters.BuilderNested classes/interfaces inherited from interface UriQuery
UriQuery.CopyableModifier and TypeInterfaceDescriptionstatic interfaceA Helidon query that can provide an independent snapshot of its parameter state. -
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. Raw and decoded parameter lists are copied independently. Generic queries are copied using raw parameter names fromUriQuery.rawValue()when those names can be looked up throughUriQuery.getAllRaw(String), retaining each serialized raw spelling. Additional nonempty raw lists exposed throughParameters.names()are copied only for decoded names absent from the serialization; empty raw lists can also retain parameter membership. A generic query cannot distinguish a decoded lookup alias from a new nonempty raw alias of an existing decoded name omitted by stale serialization. Such supplemental raw aliases are not copied. If a serialized name cannot be looked up, raw lookups instead useParameters.names(), preserving the historical lookup behavior for decorators that rewrite serialized names. This fallback cannot retain raw aliases that the parameter names do not expose. Names from this fallback or supplemental lookups are query-encoded before being written. Values are read from the current parameter lists rather than the serialized query.- Parameters:
uriQuery- uri query to read- Returns:
- updated instance
- Throws:
NoSuchElementException- if the source supports raw lookups by neither its serialized names nor its parameter names
-
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.
-