Package io.micronaut.web.router
Interface RouteMatch<R>
- Type Parameters:
R
- The route
- All Superinterfaces:
AnnotationMetadataProvider
,AnnotationSource
,Callable<R>
,Predicate<HttpRequest>
,RouteInfo<R>
- All Known Subinterfaces:
MethodBasedRouteMatch<T,
,R> UriRouteMatch<T,
R>
- All Known Implementing Classes:
BasicObjectRouteMatch
A
Route
that is executable.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptiondefault R
call()
Same asexecute()
.decorate
(Function<RouteMatch<R>, R> executor) Decorates the execution of the route with the given executor.boolean
doesConsume
(MediaType contentType) Whether the specified content type is an accepted type.boolean
doesProduce
(MediaType acceptableType) Whether the route does produce any of the given types.boolean
doesProduce
(Collection<MediaType> acceptableTypes) Whether the route does produce any of the given types.default R
execute()
Execute the route with the given values.Execute the route with the given values.default boolean
explicitlyConsumes
(MediaType contentType) Whether the specified content type is explicitly an accepted type.default boolean
explicitlyProduces
(MediaType contentType) Whether the specified content type is explicitly a producing type.Returns a newRouteMatch
fulfilling arguments required by this route to execute.The media types able to produced by this route.default Collection<Argument<?>>
Returns the required arguments for this RouteMatch.getRequiredInput
(String name) Return whether the given named input is required by this route.ReturnType<? extends R>
default boolean
default boolean
isRequiredInput
(String name) Return whether the given named input is required by this route.default boolean
isSatisfied
(String name) Is the given input satisfied.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
Methods inherited from interface io.micronaut.web.router.RouteInfo
findStatus, getBodyType, getConsumes, getDeclaringType, isAsync, isAsyncOrReactive, isCompletable, isErrorRoute, isReactive, isSingleResult, isSpecifiedSingle, isSuspended, isVoid, isWebSocketRoute
-
Method Details
-
getVariableValues
- Returns:
- The variable values following a successful match.
-
execute
Execute the route with the given values. The passed map should contain values for every argument returned bygetRequiredArguments()
.- Parameters:
argumentValues
- The argument values- Returns:
- The result
-
fulfill
Returns a newRouteMatch
fulfilling arguments required by this route to execute. The new route will not return the given arguments from thegetRequiredArguments()
method.- Parameters:
argumentValues
- The argument values- Returns:
- The fulfilled route
-
decorate
Decorates the execution of the route with the given executor.- Parameters:
executor
- The executor- Returns:
- A new route match
-
getRequiredInput
Return whether the given named input is required by this route.- Parameters:
name
- The name of the input- Returns:
- True if it is
-
getBodyArgument
- Returns:
- The argument that represents the body
-
getProduces
The media types able to produced by this route.- Specified by:
getProduces
in interfaceRouteInfo<R>
- Returns:
- A list of
MediaType
that this route can produce
-
getRequiredArguments
Returns the required arguments for this RouteMatch.
- Returns:
- The required arguments in order to invoke this route
-
getReturnType
ReturnType<? extends R> getReturnType()- Specified by:
getReturnType
in interfaceRouteInfo<R>
- Returns:
- The return type
-
execute
Execute the route with the given values. Note if there are required arguments returned fromgetRequiredArguments()
this method will throw anIllegalArgumentException
.- Returns:
- The result
-
call
Same asexecute()
. -
isExecutable
default boolean isExecutable()- Returns:
- Whether the route match can be executed without passing any additional arguments ie. via
execute()
-
isRequiredInput
Return whether the given named input is required by this route.- Parameters:
name
- The name of the input- Returns:
- True if it is
-
doesConsume
Whether the specified content type is an accepted type.- Parameters:
contentType
- The content type- Returns:
- True if it is
-
doesProduce
Whether the route does produce any of the given types.- Parameters:
acceptableTypes
- The acceptable types- Returns:
- True if it is
-
doesProduce
Whether the route does produce any of the given types.- Parameters:
acceptableType
- The acceptable type- Returns:
- True if it is
-
explicitlyConsumes
Whether the specified content type is explicitly an accepted type.- Parameters:
contentType
- The content type- Returns:
- True if it is
-
explicitlyProduces
Whether the specified content type is explicitly a producing type.- Parameters:
contentType
- The content type- Returns:
- True if it is
- Since:
- 2.5.0
-
isSatisfied
Is the given input satisfied.- Parameters:
name
- The name of the input- Returns:
- True if it is
-