Interface Route

All Known Subinterfaces:
ErrorRoute, ResourceRoute, StatusRoute, UriRoute

public interface Route
Represents a Route definition constructed by a RouteBuilder.
Since:
1.0
Author:
Graeme Rocher
See Also:
  • Field Details

    • DEFAULT_PRODUCES

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

    • toRouteInfo

      RouteInfo<Object> toRouteInfo()
    • consumes

      Route consumes(MediaType... mediaType)
      Applies the given accepted media type the route.
      Parameters:
      mediaType - The media type
      Returns:
      A new route with the media type applied
    • produces

      Route produces(MediaType... mediaType)
      Applies the given accepted media type the route.
      Parameters:
      mediaType - The media type
      Returns:
      A new route with the media type applied
    • consumesAll

      Route consumesAll()
      Accept all MediaType references.
      Returns:
      A new route with the media type applied
    • nest

      Route nest(Runnable nested)
      Defines routes nested within this route.
      Parameters:
      nested - The nested routes
      Returns:
      This route
    • where

      Route where(Predicate<HttpRequest<?>> condition)
      Match this Route only if the given predicate is true.
      Parameters:
      condition - The condition which accepts a HttpRequest
      Returns:
      This route
    • body

      Route body(String argument)
      The name of the argument to the route that is the request body.
      Parameters:
      argument - The argument
      Returns:
      This route
    • body

      Route body(Argument<?> argument)
      The name of the argument to the route that is the request body.
      Parameters:
      argument - The argument
      Returns:
      This route
    • getProduces

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

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