com.vaadin.flow.router.
Class NavigationState
- java.lang.Object
-
- com.vaadin.flow.router.NavigationState
-
All Implemented Interfaces:
public class NavigationState extends Object implements Serializable
Contains all relevant information related to a valid navigation.
Since:
1.0.
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description NavigationState(Router router)
Creates a new instance of the class using the
router
.
-
Method Summary
All Methods Modifier and Type Method Description Class<? extends Component>
getNavigationTarget()
Gets the navigation target of this state.
String
getResolvedPath()
Get the resolved path details for this navigation state.
RouteParameters
getRouteParameters()
Gets the route parameters map.
RouteTarget
getRouteTarget()
Gets the route target for this navigation state.
Optional<List<String>>
getUrlParameters()
Gets the list of strings that correspond to the raw string url parameters.
void
setNavigationTarget(Class<? extends Component> navigationTarget)
Sets the navigation target of this state.
void
setResolvedPath(String resolvedPath)
Set the path for the resolved navigation target.
void
setUrlParameters(List<String> parameters)
Deprecated.
usesetRouteParameters(RouteParameters)
instead.
-
-
-
Constructor Detail
-
NavigationState
public NavigationState(Router router)
Creates a new instance of the class using the
router
.Parameters:
router
- the router managing navigation
-
-
Method Detail
-
getNavigationTarget
public Class<? extends Component> getNavigationTarget()
Gets the navigation target of this state.
Returns:
the navigation target of this state
-
setNavigationTarget
public void setNavigationTarget(Class<? extends Component> navigationTarget)
Sets the navigation target of this state.
Parameters:
navigationTarget
- navigation target
-
getRouteTarget
public RouteTarget getRouteTarget()
Gets the route target for this navigation state.
Returns:
the route target to navigate to.
-
setResolvedPath
public void setResolvedPath(String resolvedPath)
Set the path for the resolved navigation target.
Parameters:
resolvedPath
- path for which the target was selected
-
getResolvedPath
public String getResolvedPath()
Get the resolved path details for this navigation state.
Returns:
the resolved path details
-
getRouteParameters
public RouteParameters getRouteParameters()
Gets the route parameters map.
Returns:
route parameters.
-
getUrlParameters
public Optional<List<String>> getUrlParameters()
Gets the list of strings that correspond to the raw string url parameters.
Returns:
the url parameters of this navigation state
-
setUrlParameters
@Deprecated public void setUrlParameters(List<String> parameters)
Deprecated.usesetRouteParameters(RouteParameters)
instead.Set the list of strings that correspond to the raw string route parameters.
Parameters:
parameters
- the url parameters to set
-
-