Class Router

    • Constructor Detail

      • Router

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

        public Router​(Object delegate)
    • Method Detail

      • getDelegate

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

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

        public Router putMetadata​(String key,
                                  Object value)
        Parameters:
        key - the metadata of key
        value - the metadata of value
        Returns:
        a reference to this, so the API can be used fluently
      • metadata

        public Map<String,​Object> metadata()
        Returns:
        the metadata of this router, never returns null.
      • getMetadata

        public <T> T getMetadata​(String key)
        Parameters:
        key - the key for the metadata
        Returns:
        the data
      • router

        public static Router router​(Vertx vertx)
        Parameters:
        vertx - the Vert.x instance
        Returns:
        the router
      • route

        public Route route()
        Returns:
        the route
      • route

        public Route route​(io.vertx.core.http.HttpMethod method,
                           String path)
        Parameters:
        method - the HTTP method to match
        path - URI paths that begin with this path will match
        Returns:
        the route
      • route

        public Route route​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • routeWithRegex

        public Route routeWithRegex​(io.vertx.core.http.HttpMethod method,
                                    String regex)
        Parameters:
        method - the HTTP method to match
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • routeWithRegex

        public Route routeWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • get

        public Route get()
        Returns:
        the route
      • get

        public Route get​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • getWithRegex

        public Route getWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • head

        public Route head()
        Returns:
        the route
      • head

        public Route head​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • headWithRegex

        public Route headWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • options

        public Route options()
        Returns:
        the route
      • options

        public Route options​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • optionsWithRegex

        public Route optionsWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • put

        public Route put()
        Returns:
        the route
      • put

        public Route put​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • putWithRegex

        public Route putWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • post

        public Route post()
        Returns:
        the route
      • post

        public Route post​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • postWithRegex

        public Route postWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • delete

        public Route delete()
        Returns:
        the route
      • delete

        public Route delete​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • deleteWithRegex

        public Route deleteWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • trace

        public Route trace()
        Returns:
        the route
      • trace

        public Route trace​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • traceWithRegex

        public Route traceWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • connect

        public Route connect()
        Returns:
        the route
      • connect

        public Route connect​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • connectWithRegex

        public Route connectWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • patch

        public Route patch()
        Returns:
        the route
      • patch

        public Route patch​(String path)
        Parameters:
        path - URI paths that begin with this path will match
        Returns:
        the route
      • patchWithRegex

        public Route patchWithRegex​(String regex)
        Parameters:
        regex - URI paths that begin with a match for this regex will match
        Returns:
        the route
      • getRoutes

        public List<Route> getRoutes()
        Returns:
        a list of all the routes on this router
      • clear

        public Router clear()
        Returns:
        a reference to this, so the API can be used fluently
      • mountSubRouter

        @Deprecated
        public Route mountSubRouter​(String mountPoint,
                                    Router subRouter)
        Deprecated.
        This method duplicates the sub router functionality from Route.subRouter(Router). Mount a sub router on this router
        Parameters:
        mountPoint - the mount point (path prefix) to mount it on
        subRouter - the router to mount as a sub router
        Returns:
        a reference to this, so the API can be used fluently
      • errorHandler

        public Router errorHandler​(int statusCode,
                                   Consumer<RoutingContext> errorHandler)
        Parameters:
        statusCode - status code the errorHandler is capable of handle
        errorHandler - error handler. Note: You must not use RoutingContext.next() inside the provided handler
        Returns:
      • handleContext

        public void handleContext​(RoutingContext context)
        Parameters:
        context - the routing context
      • handleFailure

        public void handleFailure​(RoutingContext context)
        Parameters:
        context - the routing context
      • modifiedHandler

        public Router modifiedHandler​(Consumer<Router> handler)
        Parameters:
        handler - a notification handler that will receive this router as argument
        Returns:
      • allowForward

        public Router allowForward​(io.vertx.ext.web.AllowForwardHeaders allowForwardHeaders)
        Parameters:
        allowForwardHeaders - to enable parsing of "forwarded"-type headers
        Returns:
        a reference to this, so the API can be used fluently
      • newInstance

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