public class DefaultNavigationParameters extends Object implements NavigationParameters
NavigationParameters implementation.| Constructor and Description |
|---|
DefaultNavigationParameters(Map<String,List<String>> queryParameters,
boolean decode)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<String>> |
getQueryParameters()
Get the URL query parameters, without any value deserialization.
|
<T> Optional<T> |
getQueryParameterValue(String name,
Class<T> type)
Get the single value of the query parameter with the given
name, deserializing it to the given value
type. |
<T> T |
getQueryParameterValue(String name,
Class<T> type,
T defaultValue)
Get the single value of the query parameter with the given
name, deserializing it to the given value
type. |
<T> List<T> |
getQueryParameterValues(String name,
Class<T> type)
Get the values of the query parameter with the given
name, deserializing it to the given value
type. |
boolean |
hasQueryParameter(String name)
Checks whether the query parameter with the given
name is available and has a value. |
public DefaultNavigationParameters(Map<String,List<String>> queryParameters, boolean decode)
queryParameters - Query parameter names and valuesdecode - Whether to decode the parameter names and values from URL representation, using the
UTF-8 charsetpublic Map<String,List<String>> getQueryParameters()
NavigationParametersgetQueryParameters in interface NavigationParameterspublic boolean hasQueryParameter(String name)
NavigationParametersname is available and has a value.hasQueryParameter in interface NavigationParametersname - The query parameter name (not null)true if the query parameter with the given name is available and has a value,
false otherwisepublic <T> List<T> getQueryParameterValues(String name, Class<T> type) throws InvalidNavigationParameterException
NavigationParametersname, deserializing it to the given value
type.
The query parameter values are deserialized using the NavigationParameterMapper.
getQueryParameterValues in interface NavigationParametersT - Deserialized value typename - The query parameter name (not null)type - The type into which the query parameter values have to be deserialized (not null)List if noneInvalidNavigationParameterException - If a deserialization error occurredpublic <T> Optional<T> getQueryParameterValue(String name, Class<T> type) throws InvalidNavigationParameterException
NavigationParametersname, deserializing it to the given value
type.
If the query parameter has more than one value, only the first one is returned.
The query parameter value is deserialized using the NavigationParameterMapper.
getQueryParameterValue in interface NavigationParametersT - Deserialized value typename - The query parameter name (not null)type - The type into which the query parameter value has to be deserialized (not null)InvalidNavigationParameterException - If a deserialization error occurredpublic <T> T getQueryParameterValue(String name, Class<T> type, T defaultValue) throws InvalidNavigationParameterException
NavigationParametersname, deserializing it to the given value
type.
If the query parameter has more than one value, only the first one is returned.
The query parameter value is deserialized using the NavigationParameterMapper.
getQueryParameterValue in interface NavigationParametersT - Deserialized value typename - The query parameter name (not null)type - The type into which the query parameter value has to be deserialized (not null)defaultValue - The default value to return if the query parameter has no valuedefaultValue if the query parameter has no valueInvalidNavigationParameterException - If a deserialization error occurredCopyright © 2020 The Holon Platform. All rights reserved.