Class RouteBuildItem.Builder

java.lang.Object
io.quarkus.vertx.http.deployment.spi.RouteBuildItem.Builder
Enclosing class:
RouteBuildItem

public static class RouteBuildItem.Builder extends Object
A builder to configure the route.
  • Method Details

    • withRouteCustomizer

      public RouteBuildItem.Builder withRouteCustomizer(Consumer<io.vertx.ext.web.Route> customizer)
      Sets a function to customize the route.
      Parameters:
      customizer - the customizer, must not be null
      Returns:
      the current builder
    • withOrder

      public RouteBuildItem.Builder withOrder(int order)
      Defines the route order.
      Parameters:
      order - the order
      Returns:
      the current builder
    • withRequestHandler

      public RouteBuildItem.Builder withRequestHandler(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler)
      Sets the request handler (mandatory)
      Parameters:
      handler - the handler, must not be null
      Returns:
      the current builder
    • asBlockingRoute

      public RouteBuildItem.Builder asBlockingRoute()
      Sets the route as a blocking route. A blocking route handler is invoked on a worker thread, and thus is allowed to block.
      Returns:
      the current builder
    • asFailureRoute

      public RouteBuildItem.Builder asFailureRoute()
      Sets the route as a failure route. A failure route handler is invoked when an exception is thrown from a route handler.
      Returns:
      the current builder
    • displayOnNotFoundPage

      public RouteBuildItem.Builder displayOnNotFoundPage()
      Adds the route to the page returned when a 404 error is returned.
      Returns:
      the current builder
    • displayOnNotFoundPage

      public RouteBuildItem.Builder displayOnNotFoundPage(String notFoundPageTitle)
      Adds the route to the page returned when a 404 error is returned, and sets the title of the page.
      Parameters:
      notFoundPageTitle - the title of the route
      Returns:
      the current builder
    • withRoutePathConfigKey

      public RouteBuildItem.Builder withRoutePathConfigKey(String attributeName)
      Sets a property configuring the route path.
      Parameters:
      attributeName - the name of the property configuring the route path
      Returns:
      the current builder
    • build

      public RouteBuildItem build()
      Validates the route and build the RouteBuildItem.
      Returns:
      the route build item