com.vaadin.flow.router.

Class RoutesChangedEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.router.RoutesChangedEvent

All Implemented Interfaces:

Serializable

public class RoutesChangedEvent extends EventObject

Result class containing the removed and added routes for the latest configuration.

Since:

1.3

See Also:

  • 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 routes

      removed - list of all the removed routes

      Throws:

      IllegalArgumentException - if source is null.

  • Method Details

    • getSource

      public RouteRegistry getSource()

      Overrides:

      getSource in class EventObject

    • 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 target

      Returns:

      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 target

      Returns:

      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 route

      Returns:

      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 route

      Returns:

      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

    • getRemovedURLs

      public List<String> getRemovedURLs()

      Get every single URL of all removed routes in this change.

      Returns:

      immutable list of all removed URLs