Class QueryString

All Implemented Interfaces:
Serializable, Cloneable, Map<String,String>, NavigableMap<String,String>, SequencedMap<String,String>, SortedMap<String,String>

public class QueryString extends TreeMap<String,String>
Since:
0.5.0
See Also:
  • Constructor Details

    • QueryString

      public QueryString()
    • QueryString

      public QueryString(Map<String,?> source)
  • Method Details

    • put

      public String put(String key, Object value)
    • toString

      public String toString()
      Overrides:
      toString in class AbstractMap<String,String>
    • toString

      public String toString(boolean canonical)
      The canonicalized query string is formed by first sorting all the query string parameters, then URI encoding both the key and value and then joining them, in order, separating key value pairs with an '&'.
      Parameters:
      canonical - whether or not the string should be canonicalized
      Returns:
      the canonical query string
    • create

      public static QueryString create(String query)
    • buildHref

      public static String buildHref(String href, QueryString qs)
      Build an href with query string. Only appends it queryArgs is NOT empty.
      Parameters:
      href - URL path
      qs - query string to append to href
      Returns:
      href + query string if query string is NOT empty, otherwise, just returns the href