Interface RouteInfo<R>

Type Parameters:
R - The result
All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource
All Known Subinterfaces:
ErrorRouteInfo<T,R>, MethodBasedRouteInfo<T,R>, StatusRouteInfo<T,R>, UriRouteInfo<T,R>
All Known Implementing Classes:
DefaultErrorRouteInfo, DefaultRequestMatcher, DefaultRouteInfo, DefaultStatusRouteInfo, DefaultUrlRouteInfo

public interface RouteInfo<R> extends io.micronaut.core.annotation.AnnotationMetadataProvider
Common information shared between route and route match.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<io.micronaut.http.MediaType>
    The default media type produced by routes.

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether this is consuming any content type.
    boolean
    doesConsume(@Nullable io.micronaut.http.MediaType contentType)
    Whether the specified content type is an accepted type.
    boolean
    doesProduce(@Nullable io.micronaut.http.MediaType acceptableType)
    Whether the route does produce any of the given types.
    boolean
    doesProduce(@Nullable Collection<io.micronaut.http.MediaType> acceptableTypes)
    Whether the route does produce any of the given types.
    boolean
    explicitlyConsumes(@Nullable io.micronaut.http.MediaType contentType)
    Whether the specified content type is explicitly an accepted type.
    boolean
    explicitlyProduces(@Nullable io.micronaut.http.MediaType contentType)
    Whether the specified content type is explicitly a producing type.
    @NonNull io.micronaut.http.HttpStatus
    findStatus(io.micronaut.http.HttpStatus defaultStatus)
    Finds predefined route http status or uses default.
    default Optional<io.micronaut.core.type.Argument<?>>
    Deprecated, for removal: This API element is subject to removal in a future version.
    default io.micronaut.core.type.Argument<?>
    Deprecated, for removal: This API element is subject to removal in a future version.
    List<io.micronaut.http.MediaType>
    The media types able to produced by this route.
     
    @Nullable ExecutorService
    getExecutor(@Nullable io.micronaut.scheduling.executor.ThreadSelection threadSelection)
     
    default Optional<io.micronaut.core.type.Argument<?>>
    Like getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e.
    default @Nullable io.micronaut.http.body.MessageBodyReader<?>
     
    default @Nullable io.micronaut.http.body.MessageBodyWriter<R>
     
    List<io.micronaut.http.MediaType>
    The media types able to produced by this route.
    Optional<io.micronaut.core.type.Argument<?>>
     
    @NonNull io.micronaut.core.type.Argument<?>
     
    io.micronaut.core.type.ReturnType<? extends R>
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    default boolean
    Is this route recognized as imperative.
    boolean
    Whether the route permits a request body.
    boolean
     
    default boolean
    Is the response body json formattable.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    Checks if route is for web socket.
    boolean
     
    default boolean
    Whether this is producing any content type.

    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
  • Field Details

    • DEFAULT_PRODUCES

      static final List<io.micronaut.http.MediaType> DEFAULT_PRODUCES
      The default media type produced by routes.
  • Method Details

    • getMessageBodyWriter

      @Nullable default @Nullable io.micronaut.http.body.MessageBodyWriter<R> getMessageBodyWriter()
      Returns:
      The message body writer, if any.
      Since:
      4.0.0
    • getMessageBodyReader

      @Nullable default @Nullable io.micronaut.http.body.MessageBodyReader<?> getMessageBodyReader()
      Returns:
      The message body reader. if any.
      Since:
      4.0.0
    • getReturnType

      io.micronaut.core.type.ReturnType<? extends R> getReturnType()
      Returns:
      The return type
    • getResponseBodyType

      @NonNull @NonNull io.micronaut.core.type.Argument<?> getResponseBodyType()
      Returns:
      The argument representing the data type being produced.
    • isResponseBodyJsonFormattable

      default boolean isResponseBodyJsonFormattable()
      Is the response body json formattable.
      Returns:
      The response body.
    • getBodyType

      @Deprecated(since="4.0", forRemoval=true) default io.micronaut.core.type.Argument<?> getBodyType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The response body type
    • getRequestBodyType

      Optional<io.micronaut.core.type.Argument<?>> getRequestBodyType()
      Returns:
      The argument that represents the body of the request
    • getBodyArgument

      @Deprecated(since="4.0", forRemoval=true) default Optional<io.micronaut.core.type.Argument<?>> getBodyArgument()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The argument that represents the body of the request
    • getFullRequestBodyType

      @Internal default Optional<io.micronaut.core.type.Argument<?>> getFullRequestBodyType()
      Like getRequestBodyType(), but excludes body arguments that may match only a part of the body (i.e. that have no @Body annotation, or where the @Body has a value set).
      Returns:
      The argument that represents the body
    • getDeclaringType

      Class<?> getDeclaringType()
      Returns:
      The declaring type of the route.
    • getProduces

      List<io.micronaut.http.MediaType> getProduces()
      The media types able to produced by this route.
      Returns:
      A list of MediaType that this route can produce
    • getConsumes

      List<io.micronaut.http.MediaType> getConsumes()
      The media types able to produced by this route.
      Returns:
      A list of MediaType that this route can produce
    • consumesAll

      default boolean consumesAll()
      Whether this is consuming any content type.
      Returns:
      True if it is
      Since:
      4.4.0
    • doesConsume

      boolean doesConsume(@Nullable @Nullable io.micronaut.http.MediaType contentType)
      Whether the specified content type is an accepted type.
      Parameters:
      contentType - The content type
      Returns:
      True if it is
    • producesAll

      default boolean producesAll()
      Whether this is producing any content type.
      Returns:
      True if it is
      Since:
      4.3.0
    • doesProduce

      boolean doesProduce(@Nullable @Nullable Collection<io.micronaut.http.MediaType> acceptableTypes)
      Whether the route does produce any of the given types.
      Parameters:
      acceptableTypes - The acceptable types
      Returns:
      True if it is
    • doesProduce

      boolean doesProduce(@Nullable @Nullable io.micronaut.http.MediaType acceptableType)
      Whether the route does produce any of the given types.
      Parameters:
      acceptableType - The acceptable type
      Returns:
      True if it is
    • explicitlyConsumes

      boolean explicitlyConsumes(@Nullable @Nullable io.micronaut.http.MediaType contentType)
      Whether the specified content type is explicitly an accepted type.
      Parameters:
      contentType - The content type
      Returns:
      True if it is
    • explicitlyProduces

      boolean explicitlyProduces(@Nullable @Nullable io.micronaut.http.MediaType contentType)
      Whether the specified content type is explicitly a producing type.
      Parameters:
      contentType - The content type
      Returns:
      True if it is
      Since:
      2.5.0
    • isSuspended

      boolean isSuspended()
      Returns:
      Is this route match a suspended function (Kotlin).
      Since:
      2.0.0
    • isImperative

      default boolean isImperative()
      Is this route recognized as imperative.
      Returns:
      Is this route recognized as imperative.
      Since:
      4.3.0
    • isReactive

      boolean isReactive()
      Returns:
      Is the route a reactive route.
      Since:
      2.0.0
    • isSingleResult

      boolean isSingleResult()
      Returns:
      Does the route emit a single result or multiple results
      Since:
      2.0
    • isSpecifiedSingle

      boolean isSpecifiedSingle()
      Returns:
      Does the route emit a single result or multiple results
      Since:
      2.0
    • isCompletable

      boolean isCompletable()
      Returns:
      is the return type completable
      Since:
      2.0
    • isAsync

      boolean isAsync()
      Returns:
      Is the route an async route.
      Since:
      2.0.0
    • isAsyncOrReactive

      boolean isAsyncOrReactive()
      Returns:
      Is the route an async or reactive route.
      Since:
      2.0.0
    • isVoid

      boolean isVoid()
      Returns:
      Does the route return void
      Since:
      2.0.0
    • isErrorRoute

      boolean isErrorRoute()
      Returns:
      True if the route was called due to an error
      Since:
      3.0.0
    • findStatus

      @NonNull @NonNull 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

      boolean isWebSocketRoute()
      Checks if route is for web socket.
      Returns:
      true if it's web socket route
      Since:
      2.5.2
    • isPermitsRequestBody

      boolean isPermitsRequestBody()
      Whether the route permits a request body.
      Returns:
      True if the route permits a request body
      Since:
      4.0.0
    • getExecutor

      @Nullable @Nullable ExecutorService getExecutor(@Nullable @Nullable io.micronaut.scheduling.executor.ThreadSelection threadSelection)
      Parameters:
      threadSelection - The thread selection
      Returns:
      The route executor
      Since:
      4.0.0
    • needsRequestBody

      boolean needsRequestBody()
      Returns:
      true if the route needs request body to be read
      Since:
      4.0.0