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 Details

    • getEntries

      List<Map.Entry<QueryParamKey,@Nullable QueryParamValue>> getEntries()
    • get

      default List<@Nullable QueryParamValue> get(String key)
    • get

      default List<@Nullable QueryParamValue> get(QueryParamKey key)
    • contains

      default boolean contains(String key)
    • contains

      default boolean contains(QueryParamKey key)
    • getKeys

      default Set<QueryParamKey> getKeys()
    • asMap

      default Map<QueryParamKey,List<@Nullable QueryParamValue>> asMap()
    • getFirst

      default @Nullable QueryParamValue getFirst(String key)
    • getFirst

      default @Nullable QueryParamValue getFirst(QueryParamKey key)
    • asDecodedMap

      default Map<String,List<String>> 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

      default List<String> getDecoded(String key)
      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

      default @Nullable String getFirstDecoded(String key)
      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 null if the key is not present
      See Also: