Package com.vaadin.flow.router
Class NavigationState
- java.lang.Object
-
- com.vaadin.flow.router.NavigationState
-
- All Implemented Interfaces:
Serializable
public class NavigationState extends Object implements Serializable
Contains all relevant information related to a valid navigation.- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NavigationState(Router router)Creates a new instance of the class using therouter.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Class<? extends Component>getNavigationTarget()Gets the navigation target of this state.StringgetResolvedPath()Get the resolved path details for this navigation state.RouteParametersgetRouteParameters()Gets the route parameters map.RouteTargetgetRouteTarget()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.voidsetNavigationTarget(Class<? extends Component> navigationTarget)Sets the navigation target of this state.voidsetResolvedPath(String resolvedPath)Set the path for the resolved navigation target.voidsetUrlParameters(List<String> parameters)Deprecated.usesetRouteParameters(RouteParameters)instead.
-
-
-
Constructor Detail
-
NavigationState
public NavigationState(Router router)
Creates a new instance of the class using therouter.- 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
-
-