Package org.wiremock.url
Interface QueryParamReader
- All Known Subinterfaces:
Query
public interface QueryParamReader
All methods accepting String as a parameter will call
encode to encode it to a valid
QueryParamKey or QueryParamValue, so must be called with an unencoded
value.-
Method Summary
Modifier and TypeMethodDescriptionReturns a map of all query parameters with decoded keys and values.default Map<QueryParamKey,List<@Nullable QueryParamValue>> asMap()default booleandefault booleancontains(QueryParamKey key) default List<@Nullable QueryParamValue>default List<@Nullable QueryParamValue>get(QueryParamKey key) getDecoded(String key) Returns all decoded values for the given key.List<Map.Entry<QueryParamKey,@Nullable QueryParamValue>> default @Nullable QueryParamValuedefault @Nullable QueryParamValuegetFirst(QueryParamKey key) default @Nullable StringgetFirstDecoded(String key) Returns the first decoded value for the given key.default Set<QueryParamKey>getKeys()
-
Method Details
-
getEntries
List<Map.Entry<QueryParamKey,@Nullable QueryParamValue>> getEntries() -
get
-
get
-
contains
-
contains
-
getKeys
-
asMap
-
getFirst
-
getFirst
-
asDecodedMap
Returns a map of all query parameters with decoded keys and values.Both keys and values are percent-decoded using UTF-8 encoding. Null values (keys without values) are represented as empty strings.
- Returns:
- a map where keys are decoded parameter names and values are lists of decoded parameter values
- See Also:
-
getDecoded
Returns all decoded values for the given key.The key is matched against decoded parameter names. Values are percent-decoded using UTF-8 encoding. Null values (keys without values) are represented as empty strings.
- Parameters:
key- the unencoded parameter name to look up- Returns:
- a list of decoded values, or an empty list if the key is not present
- See Also:
-
getFirstDecoded
Returns the first decoded value for the given key.The key is matched against decoded parameter names. The value is percent-decoded using UTF-8 encoding. If the key exists but has no value, an empty string is returned.
- Parameters:
key- the unencoded parameter name to look up- Returns:
- the first decoded value, or
nullif the key is not present - See Also:
-