Package com.okta.commons.http
Class QueryString
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,String> NavigableMap<String,,String> SequencedMap<String,,String> SortedMap<String,String>
- Since:
- 0.5.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildHref(String href, QueryString qs) Build an href with query string.static QueryStringtoString()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 '&'.Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, merge, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, putFirst, putIfAbsent, putLast, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, isEmptyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.NavigableMap
reversedMethods inherited from interface java.util.SequencedMap
sequencedEntrySet, sequencedKeySet, sequencedValues
-
Constructor Details
-
QueryString
public QueryString() -
QueryString
-
-
Method Details
-
put
-
toString
- Overrides:
toStringin classAbstractMap<String,String>
-
toString
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
-
buildHref
Build an href with query string. Only appends it queryArgs is NOT empty.- Parameters:
href- URL pathqs- query string to append to href- Returns:
- href + query string if query string is NOT empty, otherwise, just returns the href
-