Package io.micronaut.web.router
Interface StatusRoute
-
- All Superinterfaces:
MethodBasedRoute,Route
public interface StatusRoute extends MethodBasedRoute
Represents aRoutethat matches a status.- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.web.router.Route
DEFAULT_PRODUCES
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StatusRouteconsumes(io.micronaut.http.MediaType... mediaType)Applies the given accepted media type the route.<T> java.util.Optional<RouteMatch<T>>match(io.micronaut.http.HttpStatus status)Match the given HTTP status.<T> java.util.Optional<RouteMatch<T>>match(java.lang.Class originatingClass, io.micronaut.http.HttpStatus status)Match the given HTTP status.StatusRoutenest(java.lang.Runnable nested)Defines routes nested within this route.java.lang.Class<?>originatingType()io.micronaut.http.HttpStatusstatus()StatusRoutewhere(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)Match thisRouteonly if the given predicate is true.-
Methods inherited from interface io.micronaut.web.router.MethodBasedRoute
getTargetMethod
-
Methods inherited from interface io.micronaut.web.router.Route
body, body, consumesAll, getConsumes, getProduces, produces
-
-
-
-
Method Detail
-
originatingType
@Nullable java.lang.Class<?> originatingType()
- Returns:
- The type the exception originates from. Null if the error route is global.
-
status
io.micronaut.http.HttpStatus status()
- Returns:
- The status
-
match
<T> java.util.Optional<RouteMatch<T>> match(io.micronaut.http.HttpStatus status)
Match the given HTTP status.- Type Parameters:
T- The matched route- Parameters:
status- The status to match- Returns:
- The route match
-
match
<T> java.util.Optional<RouteMatch<T>> match(java.lang.Class originatingClass, io.micronaut.http.HttpStatus status)
Match the given HTTP status.- Type Parameters:
T- The matched route- Parameters:
originatingClass- The class where the error originates fromstatus- The status to match- Returns:
- The route match
-
consumes
StatusRoute consumes(io.micronaut.http.MediaType... mediaType)
Description copied from interface:RouteApplies the given accepted media type the route.
-
nest
StatusRoute nest(java.lang.Runnable nested)
Description copied from interface:RouteDefines routes nested within this route.
-
where
StatusRoute where(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)
Description copied from interface:RouteMatch thisRouteonly if the given predicate is true.
-
-