类 RequestPredicates
java.lang.Object
cn.taketoday.web.handler.function.RequestPredicates
Implementations of
RequestPredicate that implement various useful
request matching operations, such as matching based on path, HTTP method, etc.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Sam Brannen, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static class(专用程序包) static classprivate static classprivate static classprivate static class(专用程序包) static classRequestPredicatethat negates a delegate predicate.(专用程序包) static classprivate static classprivate static classprivate static class(专用程序包) static classExtension ofRequestPredicatethat can modify theServerRequest.private static classstatic interfaceReceives notifications from the logical structure of request predicates. -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static RequestPredicateReturn aRequestPredicatethat tests if the request's accept header is compatible with any of the given media types.static RequestPredicateall()Return aRequestPredicatethat always matches.static RequestPredicatecontentType(MediaType... mediaTypes) Return aRequestPredicatethat tests if the request's content type is included by any of the given media types.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isDELETEand the givenpatternmatches against the request path.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isGETand the givenpatternmatches against the request path.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isHEADand the givenpatternmatches against the request path.static RequestPredicateheaders(Predicate<ServerRequest.Headers> headersPredicate) Return aRequestPredicatethat tests the request's headers against the given headers predicate.private static PathPatternmergePatterns(PathPattern oldPattern, PathPattern newPattern) static RequestPredicatemethod(HttpMethod httpMethod) Return aRequestPredicatethat matches if the request's HTTP method is equal to the given method.static RequestPredicatemethods(HttpMethod... httpMethods) Return aRequestPredicatethat matches if the request's HTTP method is equal to one the of the given methods.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isOPTIONSand the givenpatternmatches against the request path.static RequestPredicateReturn aRequestPredicatethat matches if the request's parameter of the given name has the given value.static RequestPredicateReturn aRequestPredicatethat matches if the request's parameter of the given name has the given value.static RequestPredicateReturn aRequestPredicatethat tests the request's parameter of the given name against the given predicate.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isPATCHand the givenpatternmatches against the request path.static RequestPredicateReturn aRequestPredicatethat tests the request path against the given path pattern.static RequestPredicatepathExtension(String extension) Return aRequestPredicatethat matches if the request's path has the given extension.static RequestPredicatepathExtension(Predicate<String> extensionPredicate) Return aRequestPredicatethat matches if the request's path matches the given predicate.static Function<String,RequestPredicate> pathPredicates(PathPatternParser patternParser) Return a function that creates new path-matchingRequestPredicatesfrom pattern Strings using the givenPathPatternParser.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isPOSTand the givenpatternmatches against the request path.static RequestPredicateReturn aRequestPredicatethat matches if request's HTTP method isPUTand the givenpatternmatches against the request path.private static voidtraceMatch(String prefix, Object desired, Object actual, boolean match)
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
RequestPredicates
public RequestPredicates()
-
-
方法详细资料
-
all
Return aRequestPredicatethat always matches.- 返回:
- a predicate that always matches
-
method
Return aRequestPredicatethat matches if the request's HTTP method is equal to the given method.- 参数:
httpMethod- the HTTP method to match against- 返回:
- a predicate that tests against the given HTTP method
-
methods
Return aRequestPredicatethat matches if the request's HTTP method is equal to one the of the given methods.- 参数:
httpMethods- the HTTP methods to match against- 返回:
- a predicate that tests against the given HTTP methods
-
path
Return aRequestPredicatethat tests the request path against the given path pattern.- 参数:
pattern- the pattern to match to- 返回:
- a predicate that tests against the given path pattern
-
pathPredicates
Return a function that creates new path-matchingRequestPredicatesfrom pattern Strings using the givenPathPatternParser.This method can be used to specify a non-default, customized
PathPatternParserwhen resolving path patterns.- 参数:
patternParser- the parser used to parse patterns given to the returned function- 返回:
- a function that resolves a pattern String into a path-matching
RequestPredicatesinstance
-
headers
Return aRequestPredicatethat tests the request's headers against the given headers predicate.- 参数:
headersPredicate- a predicate that tests against the request headers- 返回:
- a predicate that tests against the given header predicate
-
contentType
Return aRequestPredicatethat tests if the request's content type is included by any of the given media types.- 参数:
mediaTypes- the media types to match the request's content type against- 返回:
- a predicate that tests the request's content type against the given media types
-
accept
Return aRequestPredicatethat tests if the request's accept header is compatible with any of the given media types.- 参数:
mediaTypes- the media types to match the request's accept header against- 返回:
- a predicate that tests the request's accept header against the given media types
-
GET
Return aRequestPredicatethat matches if request's HTTP method isGETand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is GET and if the given pattern matches against the request path
-
HEAD
Return aRequestPredicatethat matches if request's HTTP method isHEADand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is HEAD and if the given pattern matches against the request path
-
POST
Return aRequestPredicatethat matches if request's HTTP method isPOSTand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is POST and if the given pattern matches against the request path
-
PUT
Return aRequestPredicatethat matches if request's HTTP method isPUTand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is PUT and if the given pattern matches against the request path
-
PATCH
Return aRequestPredicatethat matches if request's HTTP method isPATCHand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is PATCH and if the given pattern matches against the request path
-
DELETE
Return aRequestPredicatethat matches if request's HTTP method isDELETEand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is DELETE and if the given pattern matches against the request path
-
OPTIONS
Return aRequestPredicatethat matches if request's HTTP method isOPTIONSand the givenpatternmatches against the request path.- 参数:
pattern- the path pattern to match against- 返回:
- a predicate that matches if the request method is OPTIONS and if the given pattern matches against the request path
-
pathExtension
Return aRequestPredicatethat matches if the request's path has the given extension.- 参数:
extension- the path extension to match against, ignoring case- 返回:
- a predicate that matches if the request's path has the given file extension
-
pathExtension
Return aRequestPredicatethat matches if the request's path matches the given predicate.- 参数:
extensionPredicate- the predicate to test against the request path extension- 返回:
- a predicate that matches if the given predicate matches against the request's path file extension
-
param
Return aRequestPredicatethat matches if the request's parameter of the given name has the given value.- 参数:
name- the name of the parameter to test against- 返回:
- a predicate that matches if the parameter has the given value
- 另请参阅:
-
ServerRequest.param(String)StringUtils.isBlank(String)
-
param
Return aRequestPredicatethat matches if the request's parameter of the given name has the given value.- 参数:
name- the name of the parameter to test againstvalue- the value of the parameter to test against- 返回:
- a predicate that matches if the parameter has the given value
- 另请参阅:
-
param
Return aRequestPredicatethat tests the request's parameter of the given name against the given predicate.- 参数:
name- the name of the parameter to test againstpredicate- the predicate to test against the parameter value- 返回:
- a predicate that matches the given predicate against the parameter of the given name
- 另请参阅:
-
traceMatch
-
mergePathVariables
-
mergePatterns
-