Class RouteBuildItem.Builder
java.lang.Object
io.quarkus.vertx.http.deployment.spi.RouteBuildItem.Builder
- Enclosing class:
- RouteBuildItem
A builder to configure the route.
-
Method Summary
Modifier and TypeMethodDescriptionSets the route as a blocking route.Sets the route as a failure route.build()Validates the route and build theRouteBuildItem.Adds the route to the page returned when a 404 error is returned.displayOnNotFoundPage(String notFoundPageTitle) Adds the route to the page returned when a 404 error is returned, and sets the title of the page.withOrder(int order) Defines the route order.withRequestHandler(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler) Sets the request handler (mandatory)withRouteCustomizer(Consumer<io.vertx.ext.web.Route> customizer) Sets a function to customize the route.withRoutePathConfigKey(String attributeName) Sets a property configuring the route path.
-
Method Details
-
withRouteCustomizer
Sets a function to customize the route.- Parameters:
customizer- the customizer, must not benull- Returns:
- the current builder
-
withOrder
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 benull- Returns:
- the current 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
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
Adds the route to the page returned when a 404 error is returned.- Returns:
- the current builder
-
displayOnNotFoundPage
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
Sets a property configuring the route path.- Parameters:
attributeName- the name of the property configuring the route path- Returns:
- the current builder
-
build
Validates the route and build theRouteBuildItem.- Returns:
- the route build item
-