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.AnnotationMetadataProvider
    Common information shared between route and route match.
    Since:
    1.0
    • Field Summary

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

        EMPTY
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default io.micronaut.http.HttpStatus findStatus​(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 boolean isAsync()  
      default boolean isAsyncOrReactive()  
      default boolean isCompletable()  
      default boolean isErrorRoute()  
      default boolean isReactive()  
      default boolean isSingleResult()  
      default boolean isSpecifiedSingle()  
      default boolean isSuspended()  
      default boolean isVoid()  
      default boolean isWebSocketRoute()
      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
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

        getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
    • 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 MediaType that 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 MediaType that 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