Interface Route

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.List<io.micronaut.http.MediaType> DEFAULT_PRODUCES
      The default media type produced by routes.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Route body​(io.micronaut.core.type.Argument<?> argument)
      The name of the argument to the route that is the request body.
      Route body​(java.lang.String argument)
      The name of the argument to the route that is the request body.
      Route consumes​(io.micronaut.http.MediaType... mediaType)
      Applies the given accepted media type the route.
      Route consumesAll()
      Accept all MediaType references.
      default java.util.List<io.micronaut.http.MediaType> getConsumes()
      The media types able to produced by this route.
      default java.util.List<io.micronaut.http.MediaType> getProduces()
      The media types able to produced by this route.
      Route nest​(java.lang.Runnable nested)
      Defines routes nested within this route.
      Route produces​(io.micronaut.http.MediaType... mediaType)
      Applies the given accepted media type the route.
      Route where​(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)
      Match this Route only if the given predicate is true.
    • Field Detail

      • DEFAULT_PRODUCES

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

      • consumes

        Route consumes​(io.micronaut.http.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​(io.micronaut.http.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​(java.lang.Runnable nested)
        Defines routes nested within this route.
        Parameters:
        nested - The nested routes
        Returns:
        This route
      • where

        Route where​(java.util.function.Predicate<io.micronaut.http.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​(java.lang.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​(io.micronaut.core.type.Argument<?> argument)
        The name of the argument to the route that is the request body.
        Parameters:
        argument - The argument
        Returns:
        This 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