Package com.vaadin.flow.router
Class QueryParameters
java.lang.Object
com.vaadin.flow.router.QueryParameters
- All Implemented Interfaces:
Serializable
Holds query parameters information.
- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQueryParameters
(Map<String, List<String>> parameters) Creates query parameters from parameter map. -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryParameters
empty()
Creates an empty query parameters information.boolean
static QueryParameters
fromString
(String queryString) Creates parameters from a query string.static QueryParameters
Creates parameters from full representation, where each parameter name may correspond to multiple values.Returns query parameters information with support for multiple values corresponding to single parameter name.Returns a UTF-8 encoded query string containing all parameter names and values suitable for appending to a URL after the?
character.int
hashCode()
static QueryParameters
Creates parameters from given key-value pair.static QueryParameters
Creates parameters from simple representation, where each parameter name corresponds to a single value.toString()
-
Constructor Details
-
QueryParameters
Creates query parameters from parameter map.- Parameters:
parameters
- the parameter map
-
-
Method Details
-
empty
Creates an empty query parameters information.- Returns:
- query parameters information
-
full
Creates parameters from full representation, where each parameter name may correspond to multiple values.- Parameters:
parameters
- query parameters map- Returns:
- query parameters information
-
simple
Creates parameters from simple representation, where each parameter name corresponds to a single value.- Parameters:
parameters
- query parameters map- Returns:
- query parameters information
-
of
Creates parameters from given key-value pair.- Parameters:
key
- the name of the parametervalue
- the value- Returns:
- query parameters information
-
fromString
Creates parameters from a query string.Note that no length checking is done for the string. It is the responsibility of the caller (or the server) to limit the length of the query string.
- Parameters:
queryString
- the query string- Returns:
- query parameters information
-
getParameters
Returns query parameters information with support for multiple values corresponding to single parameter name.Example:
https://example.com/?one=1&two=2&one=3
will result in the corresponding map:{"one" : [1, 3], "two": [2]}
- Returns:
- query parameters information
-
getQueryString
Returns a UTF-8 encoded query string containing all parameter names and values suitable for appending to a URL after the?
character. Parameters may appear in different order than in the query string they were originally parsed from, and may be differently encoded (for example, if a space was encoded as+
in the initial URL it will be encoded as%20
in the result.- Returns:
- query string suitable for appending to a URL
- See Also:
-
toString
-
equals
-
hashCode
public int hashCode()
-