Class Route


  • public class Route
    extends Object
    A route is a holder for a set of criteria which determine whether an HTTP request or failure should be routed to a handler.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Field Detail

    • Constructor Detail

      • Route

        public Route​(io.vertx.ext.web.Route delegate)
      • Route

        public Route​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.web.Route getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • method

        public Route method​(io.vertx.core.http.HttpMethod method)
        Parameters:
        method - the HTTP method to add
        Returns:
        a reference to this, so the API can be used fluently
      • path

        public Route path​(String path)
        Parameters:
        path - the path prefix
        Returns:
        a reference to this, so the API can be used fluently
      • pathRegex

        public Route pathRegex​(String path)
        Parameters:
        path - the path regex
        Returns:
        a reference to this, so the API can be used fluently
      • produces

        public Route produces​(String contentType)
        Parameters:
        contentType - the content type
        Returns:
        a reference to this, so the API can be used fluently
      • consumes

        public Route consumes​(String contentType)
        Parameters:
        contentType - the content type
        Returns:
        a reference to this, so the API can be used fluently
      • virtualHost

        public Route virtualHost​(String hostnamePattern)
        Parameters:
        hostnamePattern - the hostname pattern that should match Host header of the requests
        Returns:
        a reference to this, so the API can be used fluently
      • order

        public Route order​(int order)
        Parameters:
        order - the order
        Returns:
        a reference to this, so the API can be used fluently
      • last

        public Route last()
        Returns:
        a reference to this, so the API can be used fluently
      • handler

        public Route handler​(Consumer<RoutingContext> requestHandler)
        Parameters:
        requestHandler - the request handler
        Returns:
      • subRouter

        public Route subRouter​(Router subRouter)
        Parameters:
        subRouter - the router to add
        Returns:
        a reference to this, so the API can be used fluently
      • blockingHandler

        public Route blockingHandler​(io.vertx.core.Handler<RoutingContext> requestHandler,
                                     boolean ordered)
        Parameters:
        requestHandler - the blocking request handler
        ordered - if true handlers are executed in sequence, otherwise are run in parallel
        Returns:
        a reference to this, so the API can be used fluently
      • failureHandler

        public Route failureHandler​(Consumer<RoutingContext> failureHandler)
        Parameters:
        failureHandler - the request handler
        Returns:
      • remove

        public Route remove()
        Returns:
        a reference to this, so the API can be used fluently
      • disable

        public Route disable()
        Returns:
        a reference to this, so the API can be used fluently
      • enable

        public Route enable()
        Returns:
        a reference to this, so the API can be used fluently
      • useNormalisedPath

        @Deprecated
        public Route useNormalisedPath​(boolean useNormalizedPath)
        Deprecated.
        Parameters:
        useNormalizedPath -
        Returns:
        the instance of Route to chain method calls.
      • useNormalizedPath

        public Route useNormalizedPath​(boolean useNormalizedPath)
        Parameters:
        useNormalizedPath - use normalized path for routing?
        Returns:
        a reference to this, so the API can be used fluently
      • getPath

        public String getPath()
        Returns:
        the path prefix (if any) for this route
      • isRegexPath

        public boolean isRegexPath()
        Returns:
        true if backed by a pattern.
      • isExactPath

        public boolean isExactPath()
        Returns:
        true if the path is exact.
      • methods

        public Set<io.vertx.core.http.HttpMethod> methods()
        Returns:
        the http methods accepted by this route
      • setRegexGroupsNames

        public Route setRegexGroupsNames​(List<String> groups)
        Parameters:
        groups - group names
        Returns:
        a reference to this, so the API can be used fluently
      • setName

        public Route setName​(String name)
        Parameters:
        name - The name of the route.
        Returns:
        a reference to this, so the API can be used fluently
      • getName

        public String getName()
        Returns:
        the name of the route. If not given explicitly, the path or the pattern or null is returned (in that order)
      • respond

        public <T> Route respond​(Function<RoutingContext,​io.smallrye.mutiny.Uni<T>> function)
        Parameters:
        function - the request handler function
        Returns:
        a reference to this, so the API can be used fluently
      • newInstance

        public static Route newInstance​(io.vertx.ext.web.Route arg)