Package io.mangoo.routing
Class Router
java.lang.Object
io.mangoo.routing.Router
- Author:
- svenkubiak
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRoute(MangooRoute route) Adds a new route to the routerstatic Stream<RequestRoute>static RequestRoutegetReverseRoute(String key) Retrieves a reverse route by its controller class and controller methodstatic Set<MangooRoute>static Stream<ServerSentEventRoute>static voidreset()Removes all routes from the router
-
Method Details
-
addRoute
Adds a new route to the router- Parameters:
route- The route to add
-
getRoutes
- Returns:
- An unmodifiable set of all configured routes
-
getRequestRoutes
- Returns:
- An unmodifiable set of all configured RequestRoutes
-
getFileRoutes
- Returns:
- An unmodifiable set of all configured FileRoutes
-
getPathRoutes
- Returns:
- An unmodifiable set of all configured PathRouts
-
getServerSentEventRoutes
- Returns:
- An unmodifiable set of all configured ServerSentEventRoutes
-
getReverseRoute
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
-