com.vaadin.flow.router.
Class RoutesChangedEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.router.RoutesChangedEvent
-
All Implemented Interfaces:
public class RoutesChangedEvent extends EventObject
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
Constructors Constructor Description RoutesChangedEvent(RouteRegistry source, List<RouteBaseData<?>> added, List<RouteBaseData<?>> removed)
Constructs a prototypical Event.
-
Method Summary
All Methods Modifier and Type Method Description List<Class<? extends Component>>
getAddedNavigationTargets()
Get every single navigation targets of all added routes in this change.
List<RouteBaseData<?>>
getAddedRoutes()
Get all routes added for this change.
List<String>
getAddedURLs()
Get every single URL of all added routes in this change.
List<Class<? extends Component>>
getRemovedNavigationTargets()
Get every single navigation targets of all removed routes in this change.
List<RouteBaseData<?>>
getRemovedRoutes()
Get all routes removed in this change.
List<String>
getRemovedURLs()
Get every single URL of all removed routes in this change.
RouteRegistry
getSource()
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 Detail
-
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 routesThrows:
IllegalArgumentException
- if source is null.
-
-
Method Detail
-
getSource
public RouteRegistry getSource()
Overrides:
getSource
in classEventObject
-
getAddedRoutes
public List<RouteBaseData<?>> getAddedRoutes()
Get all routes added for this change.
Returns:
immutable list of all added routes
-
getRemovedRoutes
public List<RouteBaseData<?>> getRemovedRoutes()
Get all routes removed in this change.
Returns:
immutable list of all removed routes
-
isRouteAdded
public boolean isRouteAdded(Class<? extends Component> clazz)
Determines if a given route navigation target was added for this change.
Parameters:
clazz
- a route navigation targetReturns:
true if the route was added for this change and false otherwise
-
isRouteRemoved
public boolean isRouteRemoved(Class<? extends Component> clazz)
Determines if a given route navigation target was removed for this change.
Parameters:
clazz
- a route navigation targetReturns:
true if the route was removed for this change and false otherwise
-
isPathAdded
public boolean isPathAdded(String path)
Determines if a route url was added for this change.
Parameters:
path
- the URL of a routeReturns:
true if the route was added for this change and false otherwise
-
isPathRemoved
public boolean isPathRemoved(String path)
Determines if a route url was removed for this change.
Parameters:
path
- the URL of a routeReturns:
true if the route was removed for this change and false otherwise
-
getAddedNavigationTargets
public List<Class<? extends Component>> getAddedNavigationTargets()
Get every single navigation targets of all added routes in this change.
Returns:
immutable list of all added navigation targets
-
getRemovedNavigationTargets
public List<Class<? extends Component>> getRemovedNavigationTargets()
Get every single navigation targets of all removed routes in this change.
Returns:
immutable list of all removed navigation targets
-
getAddedURLs
public List<String> getAddedURLs()
Get every single URL of all added routes in this change.
Returns:
immutable list of all added URLs
-
-