Class RouteAttributes
java.lang.Object
io.micronaut.web.router.RouteAttributes
Accessors for various route- and server-related attributes.
- Since:
- 4.8.0
-
Method Summary
Modifier and TypeMethodDescriptiongetException(io.micronaut.http.HttpResponse<?> response) Get the exception that triggered this response.getHeadBody(io.micronaut.http.HttpResponse<?> response) Get the body that was discarded because this is a response to a HEAD request.getRouteInfo(io.micronaut.http.HttpRequest<?> request) Get the route info.getRouteInfo(io.micronaut.http.HttpResponse<?> response) Get the route info.static Optional<RouteMatch<?>> getRouteMatch(io.micronaut.http.HttpRequest<?> request) Get the route match.static Optional<RouteMatch<?>> getRouteMatch(io.micronaut.http.HttpResponse<?> response) Get the route match.static voidsetException(io.micronaut.http.HttpResponse<?> response, Throwable throwable) Set the exception that triggered this response.static voidsetHeadBody(io.micronaut.http.HttpResponse<?> response, Object body) Set the body that was discarded because this is a response to a HEAD request.static voidsetRouteInfo(io.micronaut.http.HttpRequest<?> request, RouteInfo<?> routeInfo) Set the route info.static voidsetRouteInfo(io.micronaut.http.HttpResponse<?> response, RouteInfo<?> routeInfo) Set the route info.static voidsetRouteMatch(io.micronaut.http.HttpRequest<?> request, RouteMatch<?> routeMatch) Set the route match.static voidsetRouteMatch(io.micronaut.http.HttpResponse<?> response, 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(io.micronaut.http.HttpRequest<?> request, 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(io.micronaut.http.HttpResponse<?> response, RouteMatch<?> routeMatch) Set the route match.- Parameters:
response- The responserouteMatch- The route match
-
getRouteInfo
-
setRouteInfo
Set the route info.- Parameters:
request- The requestrouteInfo- The route info
-
getRouteInfo
-
setRouteInfo
Set the route info.- Parameters:
response- The responserouteInfo- The route info
-
getException
-
setException
Set the exception that triggered this response.- Parameters:
response- The responsethrowable- The exception
-
getHeadBody
-
setHeadBody
Set the body that was discarded because this is a response to a HEAD request.- Parameters:
response- The responsebody- The body
-