Package io.micronaut.web.router
Interface UriRoute
-
-
Field Summary
-
Fields inherited from interface io.micronaut.web.router.Route
DEFAULT_PRODUCES
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description UriRoutebody(java.lang.String argument)The name of the argument to the route that is the request body.UriRouteconsumes(io.micronaut.http.MediaType... mediaType)Applies the given accepted media type the route.UriRouteconsumesAll()Accept allMediaTypereferences.UriRouteexposedPort(int port)The exposed port that the route applies to.io.micronaut.http.HttpMethodgetHttpMethod()default java.lang.StringgetHttpMethodName()java.lang.IntegergetPort()io.micronaut.http.uri.UriMatchTemplategetUriMatchTemplate()java.util.Optional<UriRouteMatch>match(java.lang.String uri)Match this route within the given URI and produce aRouteMatchif a match is found.default java.util.Optional<UriRouteMatch>match(java.net.URI uri)Match this route within the given URI and produce aRouteMatchif a match is found.UriRoutenest(java.lang.Runnable nested)Defines routes nested within this route.UriRouteproduces(io.micronaut.http.MediaType... mediaType)Applies the given accepted media type the route.UriRoutewhere(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.Route
body, getConsumes, getProduces
-
-
-
-
Method Detail
-
nest
UriRoute nest(java.lang.Runnable nested)
Defines routes nested within this route.
-
getHttpMethod
io.micronaut.http.HttpMethod getHttpMethod()
- Returns:
- The HTTP method for this route
-
getUriMatchTemplate
io.micronaut.http.uri.UriMatchTemplate getUriMatchTemplate()
- Returns:
- The
UriMatchTemplateused to match URIs
-
match
default java.util.Optional<UriRouteMatch> match(java.net.URI uri)
Match this route within the given URI and produce aRouteMatchif a match is found.- Specified by:
matchin interfaceio.micronaut.http.uri.UriMatcher- Parameters:
uri- The URI The URI- Returns:
- An
OptionalofRouteMatch
-
match
java.util.Optional<UriRouteMatch> match(java.lang.String uri)
Match this route within the given URI and produce aRouteMatchif a match is found.- Specified by:
matchin interfaceio.micronaut.http.uri.UriMatcher- Parameters:
uri- The URI The URI- Returns:
- An
OptionalofRouteMatch
-
consumes
UriRoute consumes(io.micronaut.http.MediaType... mediaType)
Description copied from interface:RouteApplies the given accepted media type the route.
-
produces
UriRoute produces(io.micronaut.http.MediaType... mediaType)
Description copied from interface:RouteApplies the given accepted media type the route.
-
consumesAll
UriRoute consumesAll()
Description copied from interface:RouteAccept allMediaTypereferences.- Specified by:
consumesAllin interfaceRoute- Returns:
- A new route with the media type applied
-
where
UriRoute where(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)
Description copied from interface:RouteMatch thisRouteonly if the given predicate is true.
-
body
UriRoute body(java.lang.String argument)
Description copied from interface:RouteThe name of the argument to the route that is the request body.
-
exposedPort
UriRoute exposedPort(int port)
The exposed port that the route applies to.- Parameters:
port- The port- Returns:
- The route
-
getPort
@Nullable java.lang.Integer getPort()
- Returns:
- The port the route listens to, or null if the default port
-
getHttpMethodName
default java.lang.String getHttpMethodName()
- Returns:
- The http method. Is equal to
getHttpMethod()value for standard http methods.
-
-