Package ai.vespa.http

Class HttpURL.Query

java.lang.Object
ai.vespa.http.HttpURL.Query
Enclosing class:
HttpURL

public static class HttpURL.Query extends Object
  • Method Details

    • empty

      public static HttpURL.Query empty()
      Creates a new, empty query part.
    • empty

      public static HttpURL.Query empty(Consumer<String> validator)
      Creates a new, empty query part, using the indicated string wrapper for keys and non-null values.
    • parse

      public static HttpURL.Query parse(String raw)
      Parses the given raw query string.
    • parse

      public static HttpURL.Query parse(String raw, Consumer<String> validator)
      Parses the given raw query string, using the validator on all keys and non-null values.
    • add

      public HttpURL.Query add(String key, String value)
      Returns a copy of this with the decoded non-null key pointing to the decoded non-null value.
    • add

      public HttpURL.Query add(String key)
      Returns a copy of this with the decoded non-null key pointing to "nothing".
    • set

      public HttpURL.Query set(String key, String value)
      Returns a copy of this with the decoded non-null key pointing only to the decoded non-null value.
    • set

      public HttpURL.Query set(String key)
      Returns a copy of this with the decoded non-null key only pointing to "nothing".
    • remove

      public HttpURL.Query remove(String key)
      Returns a copy of this without any key-value pair with the decoded key.
    • add

      public HttpURL.Query add(Map<String,? extends Iterable<String>> values)
      Returns a copy of this with all given mappings appended to this. null values, but not lists of values, are allowed.
    • set

      public HttpURL.Query set(Map<String,String> values)
      Returns a copy of this with all given mappings added to this, possibly replacing existing mappings.
    • remove

      public HttpURL.Query remove(Collection<String> keys)
      Returns a copy of this with all given keys removed.
    • lastEntries

      public Map<String,String> lastEntries()
      A mutable copy of the URL decoded key-value pairs that make up this query. Keys and values may be "", and values are null when only key was specified. When a key was used multiple times, this map contains only the last value associated with the key.
    • entries

      public Map<String,List<String>> entries()
      A mutable copy of the URL decoded key-value pairs that make up this query. Keys and values may be "", and values (not lists of values) are null when only key was specified. When a key was used multiple times, this map lists the values in the same order as they were given.
    • toString

      public String toString()
      Intentionally not usable for constructing new URIs. Use HttpURL for that instead.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object