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, 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

    • getMessageBodyWriter

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

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

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

      @NonNull @NonNull 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 Argument<?> getBodyType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The response body type
    • getRequestBodyType

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

      @Deprecated(since="4.0", forRemoval=true) default Optional<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<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<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 @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 @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 @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 @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 @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 @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

      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