goog.Uri.QueryData
Provided By |
---|
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.
new QueryData( opt_query, opt_ignoreCase )
Parameters |
|
---|
Instance Methods
this.add( key, value ) → goog.Uri.QueryData
goog.Uri.QueryData
Adds a key value pair.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.clear() → void
void
Clears the parameters.
this.clone() → goog.Uri.QueryData
goog.Uri.QueryData
Clone the query data instance.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.containsKey( key ) → boolean
boolean
this.containsValue( value ) → boolean
boolean
Whether there is a parameter with the given value.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.extend( ...var_args ) → void
void
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.
Parameters |
|
---|
this.filterKeys( keys ) → goog.Uri.QueryData
goog.Uri.QueryData
Removes all keys that are not in the provided list. (Modifies this object.)
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.forEach<SCOPE>( f, opt_scope ) → void
void
Runs a callback on every key-value pair in the map, including duplicate keys. This won't maintain original order when duplicate keys are interspersed (like getKeys() / getValues()).
Parameters |
|
---|
this.get( key, opt_default ) → *
*
Returns the first value associated with the key. If the query data has no such key this will return undefined or the optional default.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.getCount() → (number|null)
(number|null)
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getValues( opt_key ) → Array<?>
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.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.isEmpty() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.remove( key ) → boolean
boolean
this.set( key, value ) → goog.Uri.QueryData
goog.Uri.QueryData
Sets a key value pair and removes all other keys with the same value.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.setIgnoreCase( ignoreCase ) → void
void
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.
Parameters |
|
---|
this.setValues( key, values ) → void
void
this.toDecodedString() → string
string
Parameters | None. | ||
---|---|---|---|
Returns |
| ||
Throws |
|
this.toString() → string
string
Parameters | None. | ||
---|---|---|---|
Returns |
|
Static Functions
QueryData.createFromKeysValues( keys, values, opt_ignoreCase ) → goog.Uri.QueryData
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
QueryData.createFromMap( map, opt_ignoreCase ) → goog.Uri.QueryData
goog.Uri.QueryData
Creates a new query data instance from a map of names and values.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|