Package org.wiremock.url
Interface Query
- All Superinterfaces:
Normalisable<Query>,org.wiremock.stringparser.ParsedString,PercentEncoded<Query>,QueryParamReader
public interface Query
extends PercentEncoded<Query>, QueryParamReader, org.wiremock.stringparser.ParsedString
Represents the query component of a URI as defined in RFC 3986 Section 3.4.
The query component contains non-hierarchical data, typically formatted as key-value pairs separated by ampersands. Query strings may contain percent-encoded characters.
Implementations must be immutable and thread-safe.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Query.Builderbuilder()static QueryEncodes a string into a valid query with proper percent-encoding.Returns a normalised form of this value.static QueryParses a string into a query.default Querydefault Queryreplace(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) default Queryreplace(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) thaw()default Querytransform(Consumer<Query.Builder> transformer) default Querydefault Querywith(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) default Querywith(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) default Querydefault Querydefault Querywithout(QueryParamKey key) default Querywithout(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) default Querywithout(QueryParamKey key, List<? extends @Nullable QueryParamValue> values) Methods inherited from interface org.wiremock.url.Normalisable
isNormalFormMethods inherited from interface org.wiremock.stringparser.ParsedString
toStringMethods inherited from interface org.wiremock.url.PercentEncoded
decode, isEmpty, lengthMethods inherited from interface org.wiremock.url.QueryParamReader
asDecodedMap, asMap, contains, contains, get, get, getDecoded, getEntries, getFirst, getFirst, getFirstDecoded, getKeys
-
Field Details
-
EMPTY
-
-
Method Details
-
parse
Parses a string into a query.- Parameters:
query- the string to parse- Returns:
- the parsed query
- Throws:
IllegalQuery- if the string is not a valid query
-
encode
Encodes a string into a valid query with proper percent-encoding.- Parameters:
unencoded- the unencoded string- Returns:
- the encoded query
-
normalise
Query normalise()Description copied from interface:NormalisableReturns a normalised form of this value.- Specified by:
normalisein interfaceNormalisable<Query>- Returns:
- a normalised value
-
with
-
with
default Query with(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) -
with
-
replace
-
replace
default Query replace(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) -
replace
-
without
-
without
-
without
-
without
default Query without(QueryParamKey key, @Nullable QueryParamValue value, @Nullable QueryParamValue... otherValues) -
without
-
builder
-
thaw
Query.Builder thaw() -
transform
-