com.vaadin.flow.router.
Class NavigationStateBuilder
A builder class for constructing new NavigationState
instances.
Since:
1.0.
Author:
Vaadin Ltd
-
Constructor Summary
ConstructorsConstructorDescriptionNavigationStateBuilder
(Router router) Constructs a new NavigationStateBuilder.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the NavigationState instance that has been built so far and resets the internal state of this builder.
Assign the path that was used for determining the navigation target.
withTarget
(RouteTarget routeTarget, RouteParameters parameters) Assigns the given route target with the given route parameters to the navigation state being built.
withTarget
(Class<? extends Component> navigationTarget) Assigns the given navigation target to the navigation state being built.
withTarget
(Class<? extends Component> navigationTarget, RouteParameters parameters) Assigns the given navigation target with the given url parameter to the navigation state being built.
-
Constructor Details
-
NavigationStateBuilder
Constructs a new NavigationStateBuilder.
Parameters:
router
- the router managing navigation
-
-
Method Details
-
withTarget
public NavigationStateBuilder withTarget(Class<? extends Component> navigationTarget, RouteParameters parameters) Assigns the given navigation target with the given url parameter to the navigation state being built.
Parameters:
navigationTarget
- the navigation targetparameters
- the route parameters of the navigation targetReturns:
this builder, for chaining
-
withTarget
Assigns the given route target with the given route parameters to the navigation state being built.
Parameters:
routeTarget
- the route targetparameters
- the route parameters of the navigation targetReturns:
this builder, for chaining
-
withTarget
Assigns the given navigation target to the navigation state being built.
Parameters:
navigationTarget
- the navigation targetReturns:
this builder, for chaining
-
withPath
Assign the path that was used for determining the navigation target.
Parameters:
path
- navigation pathReturns:
this builder, for chaining
-
build
Returns the NavigationState instance that has been built so far and resets the internal state of this builder.
Returns:
the built NavigationState instance
-