接口的使用
org.springframework.web.servlet.function.RequestPredicate
使用RequestPredicate的程序包 程序包 说明 org.springframework.web.servlet.function Provides the types that make up Spring's functional web framework for Servlet environments.org.springframework.web.servlet.function中RequestPredicate的使用
返回RequestPredicate的org.springframework.web.servlet.function中的方法 修饰符和类型 方法 说明 static RequestPredicate
RequestPredicates. accept(MediaType... mediaTypes)
Return aRequestPredicate
that tests if the request's accept header is compatible with any of the given media types.static RequestPredicate
RequestPredicates. all()
Return aRequestPredicate
that always matches.default RequestPredicate
RequestPredicate. and(RequestPredicate other)
Return a composed request predicate that tests against both this predicate AND theother
predicate.static RequestPredicate
RequestPredicates. contentType(MediaType... mediaTypes)
Return aRequestPredicate
that tests if the request's content type is included by any of the given media types.static RequestPredicate
RequestPredicates. DELETE(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isDELETE
and the givenpattern
matches against the request path.static RequestPredicate
RequestPredicates. GET(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isGET
and the givenpattern
matches against the request path.static RequestPredicate
RequestPredicates. HEAD(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isHEAD
and the givenpattern
matches against the request path.static RequestPredicate
RequestPredicates. headers(Predicate<ServerRequest.Headers> headersPredicate)
Return aRequestPredicate
that tests the request's headers against the given headers predicate.static RequestPredicate
RequestPredicates. method(HttpMethod httpMethod)
Return aRequestPredicate
that matches if the request's HTTP method is equal to the given method.static RequestPredicate
RequestPredicates. methods(HttpMethod... httpMethods)
Return aRequestPredicate
that matches if the request's HTTP method is equal to one the of the given methods.default RequestPredicate
RequestPredicate. negate()
Return a predicate that represents the logical negation of this predicate.static RequestPredicate
RequestPredicates. OPTIONS(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isOPTIONS
and the givenpattern
matches against the request path.default RequestPredicate
RequestPredicate. or(RequestPredicate other)
Return a composed request predicate that tests against both this predicate OR theother
predicate.static RequestPredicate
RequestPredicates. param(String name, String value)
Return aRequestPredicate
that matches if the request's parameter of the given name has the given value.static RequestPredicate
RequestPredicates. param(String name, Predicate<String> predicate)
Return aRequestPredicate
that tests the request's parameter of the given name against the given predicate.static RequestPredicate
RequestPredicates. PATCH(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isPATCH
and the givenpattern
matches against the request path.static RequestPredicate
RequestPredicates. path(String pattern)
Return aRequestPredicate
that tests the request path against the given path pattern.static RequestPredicate
RequestPredicates. pathExtension(String extension)
Return aRequestPredicate
that matches if the request's path has the given extension.static RequestPredicate
RequestPredicates. pathExtension(Predicate<String> extensionPredicate)
Return aRequestPredicate
that matches if the request's path matches the given predicate.static RequestPredicate
RequestPredicates. POST(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isPOST
and the givenpattern
matches against the request path.static RequestPredicate
RequestPredicates. PUT(String pattern)
Return aRequestPredicate
that matches if request's HTTP method isPUT
and the givenpattern
matches against the request path.返回变量类型为RequestPredicate的类型的org.springframework.web.servlet.function中的方法 修饰符和类型 方法 说明 static Function<String,RequestPredicate>
RequestPredicates. pathPredicates(PathPatternParser patternParser)
Return a function that creates new path-matchingRequestPredicates
from pattern Strings using the givenPathPatternParser
.参数类型为RequestPredicate的org.springframework.web.servlet.function中的方法 修饰符和类型 方法 说明 default RequestPredicate
RequestPredicate. and(RequestPredicate other)
Return a composed request predicate that tests against both this predicate AND theother
predicate.default RouterFunction<T>
RouterFunction. andNest(RequestPredicate predicate, RouterFunction<T> routerFunction)
Return a composed routing function that routes to the given router function if this route does not match and the given request predicate applies.default RouterFunction<T>
RouterFunction. andRoute(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
Return a composed routing function that routes to the given handler function if this route does not match and the given request predicate applies.RouterFunctions.Builder
RouterFunctions.Builder. DELETE(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPDELETE
requests that match the given pattern and predicate.void
RouterFunctions.Visitor. endNested(RequestPredicate predicate)
Receive notification of the end of a nested router function.RouterFunctions.Builder
RouterFunctions.Builder. GET(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPGET
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. HEAD(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPHEAD
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. nest(RequestPredicate predicate, Consumer<RouterFunctions.Builder> builderConsumer)
Route to a built router function if the given request predicate applies.RouterFunctions.Builder
RouterFunctions.Builder. nest(RequestPredicate predicate, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier)
Route to the supplied router function if the given request predicate applies.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions. nest(RequestPredicate predicate, RouterFunction<T> routerFunction)
Route to the given router function if the given request predicate applies.RouterFunctions.Builder
RouterFunctions.Builder. OPTIONS(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPOPTIONS
requests that match the given pattern and predicate.default RequestPredicate
RequestPredicate. or(RequestPredicate other)
Return a composed request predicate that tests against both this predicate OR theother
predicate.RouterFunctions.Builder
RouterFunctions.Builder. PATCH(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPATCH
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. POST(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPOST
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. PUT(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPUT
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. route(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all requests that match the given predicate.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions. route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
Route to the given handler function if the given request predicate applies.void
RouterFunctions.Visitor. route(RequestPredicate predicate, HandlerFunction<?> handlerFunction)
Receive notification of a standard predicated route to a handler function.void
RouterFunctions.Visitor. startNested(RequestPredicate predicate)
Receive notification of the beginning of a nested router function.void
RequestPredicates.Visitor. unknown(RequestPredicate predicate)
Receive first notification of an unknown predicate.