Interface UriQuery

All Superinterfaces:
Parameters
All Known Subinterfaces:
UriQueryWriteable

public interface UriQuery extends Parameters
HTTP Query representation. Query is the section separated by ? character from the path, where each query parameter is separated by & character.
  • Method Details

    • create

      static UriQuery create(String query)
      Create a new HTTP query from the query string.
      Parameters:
      query - raw query string
      Returns:
      HTTP query instance
    • empty

      static UriQuery empty()
      Create an empty HTTP query.
      Returns:
      HTTP query instance
    • create

      static UriQuery create(URI uri)
      Create URI query from a URI instance.
      Parameters:
      uri - URI to use as the source of this query
      Returns:
      HTTP query instance either empty (if query section of the provided URI is null) or create(String) with the raw query
    • rawValue

      String rawValue()
      Query fully encoded, without the leading ? character.
      Returns:
      raw query to be sent (or that was received) over the wire
    • value

      String value()
      Query NOT encoded without the leading ? character.
      Returns:
      query to be sent (or that was received) over the wire but decoded
    • getRaw

      String getRaw(String name) throws NoSuchElementException
      Get raw value (undecoded) of a query parameter by its name.
      Parameters:
      name - query parameter name
      Returns:
      value of the parameter, raw
      Throws:
      NoSuchElementException - in case the parameter does not exist
    • getAllRaw

      List<String> getAllRaw(String name) throws NoSuchElementException
      Get all raw values (undecoded) of a query parameter by its name.
      Parameters:
      name - query parameter name
      Returns:
      values of the parameter, raw
      Throws:
      NoSuchElementException - in case the parameter does not exist