Package com.vaadin.flow.router
Class RouteParameters
java.lang.Object
com.vaadin.flow.router.RouteParameters
- All Implemented Interfaces:
Serializable
Immutable container which stores the route parameters extracted from a
navigation url received from the client.
- See Also:
-
Constructor Summary
ConstructorDescriptionRouteParameters
(RouteParam... params) Creates a RouteParameters container using the givenRouteParam
s.RouteParameters
(String name, String value) Creates a RouteParameters instance using only one parameter.RouteParameters
(Map<String, String> params) Creates a RouteParameters container using the given map as argument. -
Method Summary
Modifier and TypeMethodDescriptionstatic RouteParameters
empty()
Creates an empty RouteParameters instance.boolean
Gets the string representation of a parameter.getInteger
(String parameterName) Gets the int representation of a parameter.Gets the long representation of a parameter.Gets the available parameter names.getWildcard
(String parameterName) Gets a list representing the wildcard value of a parameter, where each element in the list is a path segment.int
hashCode()
toString()
-
Constructor Details
-
RouteParameters
Creates a RouteParameters container using the given map as argument.- Parameters:
params
- parameters mapping containing the parameter names mapping their values.
-
RouteParameters
Creates a RouteParameters container using the givenRouteParam
s.- Parameters:
params
- the list of parameters and their values.- Throws:
IllegalArgumentException
- if a parameter is given more than once.
-
RouteParameters
Creates a RouteParameters instance using only one parameter.- Parameters:
name
- the name of the parameter.value
- the value of the parameter.
-
-
Method Details
-
empty
Creates an empty RouteParameters instance.- Returns:
- an empty instance of RouteParameters.
-
getParameterNames
Gets the available parameter names.- Returns:
- the available parameter names.
-
get
Gets the string representation of a parameter. -
getInteger
Gets the int representation of a parameter.- Parameters:
parameterName
- the name of the parameter.- Returns:
- an
Optional
Integer
representation of the parameter. If the value is missing theOptional
is empty. - Throws:
NumberFormatException
- if the value cannot be parsed as an Integer.
-
getLong
Gets the long representation of a parameter.- Parameters:
parameterName
- the name of the parameter.- Returns:
- an
Optional
Long
representation of the parameter. If the value is missing theOptional
is empty. - Throws:
NumberFormatException
- if the value cannot be parsed as a Long.
-
getWildcard
Gets a list representing the wildcard value of a parameter, where each element in the list is a path segment. In case the value is missing the result is an emptyList
. -
toString
-
equals
-
hashCode
public int hashCode()
-