Package com.vaadin.flow.router
Class RoutesChangedEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.router.RoutesChangedEvent
- All Implemented Interfaces:
Serializable
Result class containing the removed and added routes for the latest
configuration.
- Since:
- 1.3
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionRoutesChangedEvent
(RouteRegistry source, List<RouteBaseData<?>> added, List<RouteBaseData<?>> removed) Constructs a prototypical Event. -
Method Summary
Modifier and TypeMethodDescriptionGet every single navigation targets of all added routes in this change.List<RouteBaseData<?>>
Get all routes added for this change.Get every single URL of all added routes in this change.Get every single navigation targets of all removed routes in this change.List<RouteBaseData<?>>
Get all routes removed in this change.Get every single URL of all removed routes in this change.boolean
isPathAdded
(String path) Determines if a route url was added for this change.boolean
isPathRemoved
(String path) Determines if a route url was removed for this change.boolean
isRouteAdded
(Class<? extends Component> clazz) Determines if a given route navigation target was added for this change.boolean
isRouteRemoved
(Class<? extends Component> clazz) Determines if a given route navigation target was removed for this change.Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
RoutesChangedEvent
public RoutesChangedEvent(RouteRegistry source, List<RouteBaseData<?>> added, List<RouteBaseData<?>> removed) Constructs a prototypical Event.- Parameters:
source
- The object on which the Event initially occurred.added
- list of all the added routesremoved
- list of all the removed routes- Throws:
IllegalArgumentException
- if source is null.
-
-
Method Details
-
getSource
- Overrides:
getSource
in classEventObject
-
getAddedRoutes
Get all routes added for this change.- Returns:
- immutable list of all added routes
-
getRemovedRoutes
Get all routes removed in this change.- Returns:
- immutable list of all removed routes
-
isRouteAdded
Determines if a given route navigation target was added for this change.- Parameters:
clazz
- a route navigation target- Returns:
- true if the route was added for this change and false otherwise
-
isRouteRemoved
Determines if a given route navigation target was removed for this change.- Parameters:
clazz
- a route navigation target- Returns:
- true if the route was removed for this change and false otherwise
-
isPathAdded
Determines if a route url was added for this change.- Parameters:
path
- the URL of a route- Returns:
- true if the route was added for this change and false otherwise
-
isPathRemoved
Determines if a route url was removed for this change.- Parameters:
path
- the URL of a route- Returns:
- true if the route was removed for this change and false otherwise
-
getAddedURLs
Get every single URL of all added routes in this change.- Returns:
- immutable list of all added URLs
-
getRemovedURLs
Get every single URL of all removed routes in this change.- Returns:
- immutable list of all removed URLs
-