Package io.micronaut.web.router
Class RouteAttributes
java.lang.Object
io.micronaut.web.router.RouteAttributes
Accessors for various route- and server-related attributes.
- Since:
- 4.8.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptiongetException(@NonNull HttpResponse<?> response) Get the exception that triggered this response.getHeadBody(@NonNull HttpResponse<?> response) Get the body that was discarded because this is a response to a HEAD request.getRouteInfo(@NonNull HttpRequest<?> request) Get the route info.getRouteInfo(@NonNull HttpResponse<?> response) Get the route info.static @NonNull Optional<RouteMatch<?>> getRouteMatch(@NonNull HttpRequest<?> request) Get the route match.static @NonNull Optional<RouteMatch<?>> getRouteMatch(@NonNull HttpResponse<?> response) Get the route match.static voidsetException(@NonNull HttpResponse<?> response, @NonNull Throwable throwable) Set the exception that triggered this response.static voidsetHeadBody(@NonNull HttpResponse<?> response, @NonNull Object body) Set the body that was discarded because this is a response to a HEAD request.static voidsetRouteInfo(@NonNull HttpRequest<?> request, @NonNull RouteInfo<?> routeInfo) Set the route info.static voidsetRouteInfo(@NonNull HttpResponse<?> response, @NonNull RouteInfo<?> routeInfo) Set the route info.static voidsetRouteMatch(@NonNull HttpRequest<?> request, @NonNull RouteMatch<?> routeMatch) Set the route match.static voidsetRouteMatch(@NonNull HttpResponse<?> response, @NonNull RouteMatch<?> routeMatch) Set the route match.
-
Method Details
-
getRouteMatch
Get the route match.- Parameters:
request- The request- Returns:
- The route match, if present
-
setRouteMatch
public static void setRouteMatch(@NonNull HttpRequest<?> request, @NonNull RouteMatch<?> routeMatch) Set the route match.- Parameters:
request- The requestrouteMatch- The route match
-
getRouteMatch
Get the route match.- Parameters:
response- The response- Returns:
- The route match, if present
-
setRouteMatch
public static void setRouteMatch(@NonNull HttpResponse<?> response, @NonNull RouteMatch<?> routeMatch) Set the route match.- Parameters:
response- The responserouteMatch- The route match
-
getRouteInfo
Get the route info.- Parameters:
request- The request- Returns:
- The route info, if present
-
setRouteInfo
Set the route info.- Parameters:
request- The requestrouteInfo- The route info
-
getRouteInfo
Get the route info.- Parameters:
response- The response- Returns:
- The route info, if present
-
setRouteInfo
Set the route info.- Parameters:
response- The responserouteInfo- The route info
-
getException
Get the exception that triggered this response.- Parameters:
response- The response- Returns:
- The exception, if present
-
setException
Set the exception that triggered this response.- Parameters:
response- The responsethrowable- The exception
-
getHeadBody
Get the body that was discarded because this is a response to a HEAD request.- Parameters:
response- The response- Returns:
- The discarded body, if present
-
setHeadBody
Set the body that was discarded because this is a response to a HEAD request.- Parameters:
response- The responsebody- The body
-