com.vaadin.flow.router.
Class NavigationStateBuilder
- java.lang.Object
-
- com.vaadin.flow.router.NavigationStateBuilder
-
public class NavigationStateBuilder extends Object
A builder class for constructing new
NavigationState
instances.Since:
1.0.
Author:
Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor and Description NavigationStateBuilder(Router router)
Constructs a new NavigationStateBuilder.
-
Method Summary
All Methods Modifier and Type Method and Description NavigationState
build()
Returns the NavigationState instance that has been built so far and resets the internal state of this builder.
NavigationStateBuilder
withPath(String path)
Assign the path that was used for determining the navigation target.
NavigationStateBuilder
withTarget(Class<? extends Component> navigationTarget)
Assigns the given navigation target to the navigation state being built.
NavigationStateBuilder
withTarget(Class<? extends Component> navigationTarget, List<String> urlParameters)
Assigns the given navigation target with the given url parameter to the navigation state being built.
-
-
-
Constructor Detail
-
NavigationStateBuilder
public NavigationStateBuilder(Router router)
Constructs a new NavigationStateBuilder.
Parameters:
router
- the router managing navigation
-
-
Method Detail
-
withTarget
public NavigationStateBuilder withTarget(Class<? extends Component> navigationTarget, List<String> urlParameters)
Assigns the given navigation target with the given url parameter to the navigation state being built.
Parameters:
navigationTarget
- the navigation targeturlParameters
- the url parameter of the navigation targetReturns:
this builder, for chaining
-
withTarget
public NavigationStateBuilder withTarget(Class<? extends Component> navigationTarget)
Assigns the given navigation target to the navigation state being built.
Parameters:
navigationTarget
- the navigation targetReturns:
this builder, for chaining
-
withPath
public NavigationStateBuilder withPath(String path)
Assign the path that was used for determining the navigation target.
Parameters:
path
- navigation pathReturns:
this builder, for chaining
-
build
public NavigationState build()
Returns the NavigationState instance that has been built so far and resets the internal state of this builder.
Returns:
the built NavigationState instance
-
-