Package io.micronaut.web.router
Interface RouteInfo<R>
-
- Type Parameters:
R- The route
- All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource
- All Known Subinterfaces:
MethodBasedRouteMatch<T,R>,RouteMatch<R>,UriRouteMatch<T,R>
- All Known Implementing Classes:
BasicObjectRouteMatch
public interface RouteInfo<R> extends io.micronaut.core.annotation.AnnotationMetadataProviderCommon information shared between route and route match.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default io.micronaut.http.HttpStatusfindStatus(io.micronaut.http.HttpStatus defaultStatus)Finds predefined route http status or uses default.default io.micronaut.core.type.Argument<?>getBodyType()default java.util.List<io.micronaut.http.MediaType>getConsumes()The media types able to produced by this route.java.lang.Class<?>getDeclaringType()default java.util.List<io.micronaut.http.MediaType>getProduces()The media types able to produced by this route.io.micronaut.core.type.ReturnType<? extends R>getReturnType()default booleanisAsync()default booleanisAsyncOrReactive()default booleanisCompletable()default booleanisErrorRoute()default booleanisReactive()default booleanisSingleResult()default booleanisSpecifiedSingle()default booleanisSuspended()default booleanisVoid()default booleanisWebSocketRoute()Checks if route is for web socket.-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
-
-
-
Method Detail
-
getReturnType
io.micronaut.core.type.ReturnType<? extends R> getReturnType()
- Returns:
- The return type
-
getBodyType
default io.micronaut.core.type.Argument<?> getBodyType()
- Returns:
- The argument representing the data type being produced.
-
getDeclaringType
java.lang.Class<?> getDeclaringType()
- Returns:
- The declaring type of the route.
-
getProduces
default java.util.List<io.micronaut.http.MediaType> getProduces()
The media types able to produced by this route.- Returns:
- A list of
MediaTypethat this route can produce
-
getConsumes
default java.util.List<io.micronaut.http.MediaType> getConsumes()
The media types able to produced by this route.- Returns:
- A list of
MediaTypethat this route can produce
-
isSuspended
default boolean isSuspended()
- Returns:
- Is this route match a suspended function (Kotlin).
- Since:
- 2.0.0
-
isReactive
default boolean isReactive()
- Returns:
- Is the route a reactive route.
- Since:
- 2.0.0
-
isSingleResult
default boolean isSingleResult()
- Returns:
- Does the route emit a single result or multiple results
- Since:
- 2.0
-
isSpecifiedSingle
default boolean isSpecifiedSingle()
- Returns:
- Does the route emit a single result or multiple results
- Since:
- 2.0
-
isCompletable
default boolean isCompletable()
- Returns:
- is the return type completable
- Since:
- 2.0
-
isAsync
default boolean isAsync()
- Returns:
- Is the route an async route.
- Since:
- 2.0.0
-
isAsyncOrReactive
default boolean isAsyncOrReactive()
- Returns:
- Is the route an async or reactive route.
- Since:
- 2.0.0
-
isVoid
default boolean isVoid()
- Returns:
- Does the route return void
- Since:
- 2.0.0
-
isErrorRoute
default boolean isErrorRoute()
- Returns:
- True if the route was called due to an error
- Since:
- 3.0.0
-
findStatus
@NonNull default io.micronaut.http.HttpStatus findStatus(io.micronaut.http.HttpStatus defaultStatus)
Finds predefined route http status or uses default.- Parameters:
defaultStatus- The default status- Returns:
- The status
- Since:
- 2.5.2
-
isWebSocketRoute
default boolean isWebSocketRoute()
Checks if route is for web socket.- Returns:
- true if it's web socket route
- Since:
- 2.5.2
-
-