类 RequestMethodsRequestCondition
java.lang.Object
cn.taketoday.web.handler.condition.AbstractRequestCondition<RequestMethodsRequestCondition>
cn.taketoday.web.handler.condition.RequestMethodsRequestCondition
- 所有已实现的接口:
RequestCondition<RequestMethodsRequestCondition>
public final class RequestMethodsRequestCondition
extends AbstractRequestCondition<RequestMethodsRequestCondition>
A logical disjunction (' || ') request condition that matches a request
against a set of
HttpMethods.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
-
字段概要
字段修饰符和类型字段说明private final Set<HttpMethod>private static final EnumMap<HttpMethod,RequestMethodsRequestCondition> Per HTTP method cache to return ready instances from getMatchingCondition. -
构造器概要
构造器限定符构造器说明RequestMethodsRequestCondition(HttpMethod... requestMethods) Create a new instance with the given request methods.privateRequestMethodsRequestCondition(Set<HttpMethod> methods) Private constructor for internal use when combining conditions. -
方法概要
修饰符和类型方法说明Returns a new instance with a union of the HTTP request methods from "this" and the "other" instance.intcompareTo(RequestMethodsRequestCondition other, RequestContext request) Returns: 0 if the two conditions contain the same number of HTTP request methods Less than 0 if "this" instance has an HTTP request method but "other" doesn't Greater than 0 "other" has an HTTP request method but "this" doesn'tprotected Collection<HttpMethod>Return the discrete items a request condition is composed of.getMatchingCondition(RequestContext request) Check if any of the HTTP request methods match the given request and return an instance that contains the matching HTTP request method only.Returns allRequestMethodscontained in this condition.protected StringThe notation to use when printing discrete items of content.private RequestMethodsRequestConditionmatchPreFlight(RequestContext request) On a pre-flight request match to the would-be, actual request.private RequestMethodsRequestConditionmatchRequestMethod(HttpMethod requestMethod) 从类继承的方法 cn.taketoday.web.handler.condition.AbstractRequestCondition
equals, hashCode, isEmpty, toString
-
字段详细资料
-
requestMethodConditionCache
Per HTTP method cache to return ready instances from getMatchingCondition. -
methods
-
-
构造器详细资料
-
RequestMethodsRequestCondition
Create a new instance with the given request methods.- 参数:
requestMethods- 0 or more HTTP request methods; if, 0 the condition will match to every request
-
RequestMethodsRequestCondition
Private constructor for internal use when combining conditions.
-
-
方法详细资料
-
getMethods
Returns allRequestMethodscontained in this condition. -
getContent
从类复制的说明:AbstractRequestConditionReturn the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- 指定者:
getContent在类中AbstractRequestCondition<RequestMethodsRequestCondition>- 返回:
- a collection of objects (never
null)
-
getToStringInfix
从类复制的说明:AbstractRequestConditionThe notation to use when printing discrete items of content.For example
" || "for URL patterns or" && "for param expressions. -
combine
Returns a new instance with a union of the HTTP request methods from "this" and the "other" instance.- 参数:
other- the condition to combine with.- 返回:
- a request condition instance that is the result of combining the two condition instances.
-
getMatchingCondition
Check if any of the HTTP request methods match the given request and return an instance that contains the matching HTTP request method only.- 参数:
request- the current request- 返回:
- the same instance if the condition is empty (unless the request
method is HTTP OPTIONS), a new condition with the matched request method,
or
nullif there is no match or the condition is empty and the request method is OPTIONS.
-
matchPreFlight
On a pre-flight request match to the would-be, actual request. Hence empty conditions is a match, otherwise try to match to the HTTP method in the "Access-Control-Request-Method" header. -
matchRequestMethod
-
compareTo
Returns:- 0 if the two conditions contain the same number of HTTP request methods
- Less than 0 if "this" instance has an HTTP request method but "other" doesn't
- Greater than 0 "other" has an HTTP request method but "this" doesn't
It is assumed that both instances have been obtained via
getMatchingCondition(RequestContext)and therefore each instance contains the matching HTTP request method only or is otherwise empty.request- the current request context
-