Interface UriRoute

  • All Superinterfaces:
    java.lang.Comparable<UriRoute>, Route, io.micronaut.http.uri.UriMatcher

    public interface UriRoute
    extends Route, io.micronaut.http.uri.UriMatcher, java.lang.Comparable<UriRoute>
    Represents a Route that matches a URI.
    Since:
    1.0
    • Method Detail

      • nest

        UriRoute nest​(java.lang.Runnable nested)
        Defines routes nested within this route.
        Specified by:
        nest in interface Route
        Parameters:
        nested - The nested routes
        Returns:
        This route
      • getHttpMethod

        io.micronaut.http.HttpMethod getHttpMethod()
        Returns:
        The HTTP method for this route
      • getUriMatchTemplate

        io.micronaut.http.uri.UriMatchTemplate getUriMatchTemplate()
        Returns:
        The UriMatchTemplate used to match URIs
      • match

        default java.util.Optional<UriRouteMatch> match​(java.net.URI uri)
        Match this route within the given URI and produce a RouteMatch if a match is found.
        Specified by:
        match in interface io.micronaut.http.uri.UriMatcher
        Parameters:
        uri - The URI The URI
        Returns:
        An Optional of RouteMatch
      • match

        java.util.Optional<UriRouteMatch> match​(java.lang.String uri)
        Match this route within the given URI and produce a RouteMatch if a match is found.
        Specified by:
        match in interface io.micronaut.http.uri.UriMatcher
        Parameters:
        uri - The URI The URI
        Returns:
        An Optional of RouteMatch
      • consumes

        UriRoute consumes​(io.micronaut.http.MediaType... mediaType)
        Description copied from interface: Route
        Applies the given accepted media type the route.
        Specified by:
        consumes in interface Route
        Parameters:
        mediaType - The media type
        Returns:
        A new route with the media type applied
      • produces

        UriRoute produces​(io.micronaut.http.MediaType... mediaType)
        Description copied from interface: Route
        Applies the given accepted media type the route.
        Specified by:
        produces in interface Route
        Parameters:
        mediaType - The media type
        Returns:
        A new route with the media type applied
      • consumesAll

        UriRoute consumesAll()
        Description copied from interface: Route
        Accept all MediaType references.
        Specified by:
        consumesAll in interface Route
        Returns:
        A new route with the media type applied
      • where

        UriRoute where​(java.util.function.Predicate<io.micronaut.http.HttpRequest<?>> condition)
        Description copied from interface: Route
        Match this Route only if the given predicate is true.
        Specified by:
        where in interface Route
        Parameters:
        condition - The condition which accepts a HttpRequest
        Returns:
        This route
      • body

        UriRoute body​(java.lang.String argument)
        Description copied from interface: Route
        The name of the argument to the route that is the request body.
        Specified by:
        body in interface Route
        Parameters:
        argument - The argument
        Returns:
        This route
      • exposedPort

        UriRoute exposedPort​(int port)
        The exposed port that the route applies to.
        Parameters:
        port - The port
        Returns:
        The route
      • getPort

        @Nullable
        java.lang.Integer getPort()
        Returns:
        The port the route listens to, or null if the default port
      • getHttpMethodName

        default java.lang.String getHttpMethodName()
        Returns:
        The http method. Is equal to getHttpMethod() value for standard http methods.