Interface RouteInfo<R>

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

public interface RouteInfo<R> extends AnnotationMetadataProvider
Common information shared between route and route match.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • DEFAULT_PRODUCES

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

    • getReturnType

      ReturnType<? extends R> getReturnType()
      Returns:
      The return type
    • getBodyType

      Argument<?> getBodyType()
      Returns:
      The argument representing the data type being produced.
    • getBodyArgument

      Optional<Argument<?>> getBodyArgument()
      Returns:
      The argument that represents the body
    • getFullBodyArgument

      @Internal default Optional<Argument<?>> getFullBodyArgument()
      Like getBodyArgument(), 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<MediaType> getProduces()
      The media types able to produced by this route.
      Returns:
      A list of MediaType that this route can produce
    • getConsumes

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

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

      boolean doesProduce(@Nullable Collection<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 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 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 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
    • 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 HttpStatus findStatus(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 ExecutorService getExecutor(@Nullable 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