Add route(RequestPredicate, HandlerFunction) to RouterFunctions builder
Closes gh-22701
This commit is contained in:
@@ -132,6 +132,12 @@ class RouterFunctionBuilder implements RouterFunctions.Builder {
|
||||
return add(RequestPredicates.OPTIONS(pattern), handlerFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RouterFunctions.Builder route(RequestPredicate predicate,
|
||||
HandlerFunction<ServerResponse> handlerFunction) {
|
||||
return add(RouterFunctions.route(predicate, handlerFunction));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RouterFunctions.Builder OPTIONS(String pattern, RequestPredicate predicate,
|
||||
HandlerFunction<ServerResponse> handlerFunction) {
|
||||
|
||||
@@ -349,6 +349,17 @@ public abstract class RouterFunctions {
|
||||
*/
|
||||
Builder OPTIONS(String pattern, HandlerFunction<ServerResponse> handlerFunction);
|
||||
|
||||
/**
|
||||
* Adds a route to the given handler function that handles all requests that match the
|
||||
* given predicate.
|
||||
*
|
||||
* @param predicate the request predicate to match
|
||||
* @param handlerFunction the handler function to handle all requests that match the predicate
|
||||
* @return this builder
|
||||
* @see RequestPredicates
|
||||
*/
|
||||
Builder route(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction);
|
||||
|
||||
/**
|
||||
* Adds a route to the given handler function that handles all HTTP {@code OPTIONS} requests
|
||||
* that match the given pattern and predicate.
|
||||
|
||||
Reference in New Issue
Block a user