Class Router

java.lang.Object
io.mangoo.routing.Router

public final class Router extends Object
Author:
svenkubiak
  • Method Details

    • addRoute

      public static void addRoute(MangooRoute route)
      Adds a new route to the router
      Parameters:
      route - The route to add
    • getRoutes

      public static Set<MangooRoute> getRoutes()
      Returns:
      An unmodifiable set of all configured routes
    • getRequestRoutes

      public static Stream<RequestRoute> getRequestRoutes()
      Returns:
      An unmodifiable set of all configured RequestRoutes
    • getFileRoutes

      public static Stream<FileRoute> getFileRoutes()
      Returns:
      An unmodifiable set of all configured FileRoutes
    • getPathRoutes

      public static Stream<PathRoute> getPathRoutes()
      Returns:
      An unmodifiable set of all configured PathRouts
    • getServerSentEventRoutes

      public static Stream<ServerSentEventRoute> getServerSentEventRoutes()
      Returns:
      An unmodifiable set of all configured ServerSentEventRoutes
    • getReverseRoute

      public static RequestRoute getReverseRoute(String key)
      Retrieves a reverse route by its controller class and controller method
      Parameters:
      key - The controller class and method in the form ControllerClass:ControllerMethod
      Returns:
      A route object based on the given controller and method or null if none found
    • reset

      public static void reset()
      Removes all routes from the router