Package io.micronaut.web.router
Interface Route
- All Known Subinterfaces:
ErrorRoute
,ResourceRoute
,StatusRoute
,UriRoute
public interface Route
Represents a Route definition constructed by a
RouteBuilder
.- Since:
- 1.0
- Author:
- Graeme Rocher
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe default media type produced by routes. -
Method Summary
Modifier and TypeMethodDescriptionThe name of the argument to the route that is the request body.The name of the argument to the route that is the request body.Applies the given accepted media type the route.Accept allMediaType
references.The media types able to produced by this route.The media types able to produced by this route.Defines routes nested within this route.Applies the given accepted media type the route.where
(Predicate<HttpRequest<?>> condition) Match thisRoute
only if the given predicate is true.
-
Field Details
-
DEFAULT_PRODUCES
The default media type produced by routes.
-
-
Method Details
-
toRouteInfo
-
consumes
Applies the given accepted media type the route.- Parameters:
mediaType
- The media type- Returns:
- A new route with the media type applied
-
produces
Applies the given accepted media type the route.- Parameters:
mediaType
- The media type- Returns:
- A new route with the media type applied
-
consumesAll
Route consumesAll()Accept allMediaType
references.- Returns:
- A new route with the media type applied
-
nest
Defines routes nested within this route.- Parameters:
nested
- The nested routes- Returns:
- This route
-
where
Match thisRoute
only if the given predicate is true.- Parameters:
condition
- The condition which accepts aHttpRequest
- Returns:
- This route
-
body
The name of the argument to the route that is the request body.- Parameters:
argument
- The argument- Returns:
- This route
-
body
The name of the argument to the route that is the request body.- Parameters:
argument
- The argument- Returns:
- This route
-
getProduces
The media types able to produced by this route.- Returns:
- A list of
MediaType
that this route can produce
-
getConsumes
The media types able to produced by this route.- Returns:
- A list of
MediaType
that this route can produce
-