Package io.mangoo.routing
Class Router
- java.lang.Object
-
- io.mangoo.routing.Router
-
public final class Router extends Object
- Author:
- svenkubiak
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddRoute(MangooRoute route)Adds a new route to the routerstatic Stream<FileRoute>getFileRoutes()static Stream<PathRoute>getPathRoutes()static Stream<RequestRoute>getRequestRoutes()static RequestRoutegetReverseRoute(String key)Retrieves a reverse route by its controller class and controller methodstatic Set<MangooRoute>getRoutes()static Stream<ServerSentEventRoute>getServerSentEventRoutes()static Stream<WebSocketRoute>getWebSocketRoutes()static voidreset()Removes all routes from the router
-
-
-
Method Detail
-
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
-
getWebSocketRoutes
public static Stream<WebSocketRoute> getWebSocketRoutes()
- Returns:
- An unmodifiable set of all configured WebSocketRoutes
-
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
-
-