Home

# Class goog.Uri.QueryData

Class used to represent URI query parameters. It is essentially a hash of name-value pairs, though a name can be present more than once. Has the same interface as the collections in goog.structs.

Instance Method Summary
| `add(string key, <Any Type> value) ⇒ !goog.Uri.QueryData` Adds a key value pair.
| `clear()` Clears the parameters.
| `clone() ⇒ !goog.Uri.QueryData` Clone the query data instance.
| `containsKey(string key) ⇒ boolean` Whether there is a parameter with the given name
| `containsValue(<Any Type> value) ⇒ boolean` Whether there is a parameter with the given value.
| `ensureKeyMapInitialized_()` If the underlying key map is not yet initialized, it parses the query string and fills the map with parsed data.
| `extend((Object|goog.Uri.QueryData|goog.structs.Map|null|undefined) var_args)` Extends a query data object with another query data or map like object. This operates 'in-place', it does not create a new QueryData object.
| `filterKeys(?Array.<string> keys) ⇒ !goog.Uri.QueryData` Removes all keys that are not in the provided list. (Modifies this object.)
| `get(string key, <Any Type> opt_default) ⇒ <Any Type>` Returns the first value associated with the key. If the query data has no such key this will return undefined or the optional default.
| `getCount() ⇒ ?number`
| `getKeyName_(<Any Type> arg) ⇒ string` Helper function to get the key name from a JavaScript object. Converts the object to a string, and to lower case if necessary.
| `getKeys() ⇒ ?Array` Returns all the keys of the parameters. If a key is used multiple times it will be included multiple times in the returned array
| `getValues(string= opt_key) ⇒ ?Array` Returns all the values of the parameters with the given name. If the query data has no such key this will return an empty array. If no key is given all values wil be returned.
| `invalidateCache_()` Invalidate the cache.
| `isEmpty() ⇒ boolean`
| `remove(string key) ⇒ boolean` Removes all the params with the given key.
| `set(string key, <Any Type> value) ⇒ !goog.Uri.QueryData` Sets a key value pair and removes all other keys with the same value.
| `setIgnoreCase(boolean ignoreCase)` Ignore case in parameter names. NOTE: If there are already key/value pairs in the QueryData, and ignoreCase_ is set to false, the keys will all be lower-cased.
| `setValues(string key, ?Array values)` Sets the values for a key, if the key has already got values defined, this will override the existing values then remove any left over
| `toDecodedString() ⇒ string`
| `toString() ⇒ string`

Static Method Summary
| `createFromKeysValues(?Array.<string> keys, ?Array values, ?goog.Uri= opt_uri, boolean= opt_ignoreCase) ⇒ !goog.Uri.QueryData` Creates a new query data instance from parallel arrays of parameter names and values. Allows for duplicate parameter names. Throws an error if the lengths of the arrays differ.
| `createFromMap((Object|goog.structs.Map) map, ?goog.Uri= opt_uri, boolean= opt_ignoreCase) ⇒ !goog.Uri.QueryData` Creates a new query data instance from a map of names and values.