public final class RequestMethodsRequestCondition extends AbstractRequestCondition<RequestMethodsRequestCondition>
RequestMethods
.Modifier and Type | Field and Description |
---|---|
private java.util.Set<RequestMethod> |
methods |
private static java.util.Map<java.lang.String,RequestMethodsRequestCondition> |
requestMethodConditionCache
Per HTTP method cache to return ready instances from getMatchingCondition.
|
Modifier | Constructor and Description |
---|---|
private |
RequestMethodsRequestCondition(java.util.Collection<RequestMethod> requestMethods) |
|
RequestMethodsRequestCondition(RequestMethod... requestMethods)
Create a new instance with the given request methods.
|
Modifier and Type | Method and Description |
---|---|
private static java.util.List<RequestMethod> |
asList(RequestMethod... requestMethods) |
RequestMethodsRequestCondition |
combine(RequestMethodsRequestCondition other)
Returns a new instance with a union of the HTTP request methods
from "this" and the "other" instance.
|
int |
compareTo(RequestMethodsRequestCondition other,
ServerWebExchange exchange)
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
|
protected java.util.Collection<RequestMethod> |
getContent()
Return the discrete items a request condition is composed of.
|
RequestMethodsRequestCondition |
getMatchingCondition(ServerWebExchange exchange)
Check if any of the HTTP request methods match the given request and
return an instance that contains the matching HTTP request method only.
|
java.util.Set<RequestMethod> |
getMethods()
Returns all
RequestMethods contained in this condition. |
protected java.lang.String |
getToStringInfix()
The notation to use when printing discrete items of content.
|
private RequestMethodsRequestCondition |
matchPreFlight(ServerHttpRequest request)
On a pre-flight request match to the would-be, actual request.
|
private RequestMethodsRequestCondition |
matchRequestMethod(java.lang.String httpMethod) |
equals, hashCode, isEmpty, toString
private static final java.util.Map<java.lang.String,RequestMethodsRequestCondition> requestMethodConditionCache
private final java.util.Set<RequestMethod> methods
public RequestMethodsRequestCondition(RequestMethod... requestMethods)
requestMethods
- 0 or more HTTP request methods;
if, 0 the condition will match to every requestprivate RequestMethodsRequestCondition(java.util.Collection<RequestMethod> requestMethods)
private static java.util.List<RequestMethod> asList(RequestMethod... requestMethods)
public java.util.Set<RequestMethod> getMethods()
RequestMethods
contained in this condition.protected java.util.Collection<RequestMethod> getContent()
AbstractRequestCondition
For example URL patterns, HTTP request methods, param expressions, etc.
getContent
in class AbstractRequestCondition<RequestMethodsRequestCondition>
null
)protected java.lang.String getToStringInfix()
AbstractRequestCondition
For example " || "
for URL patterns or " && "
for param expressions.
getToStringInfix
in class AbstractRequestCondition<RequestMethodsRequestCondition>
public RequestMethodsRequestCondition combine(RequestMethodsRequestCondition other)
other
- the condition to combine with.@Nullable public RequestMethodsRequestCondition getMatchingCondition(ServerWebExchange exchange)
exchange
- the current exchangenull
if there is no match or the condition is empty and the
request method is OPTIONS.@Nullable private RequestMethodsRequestCondition matchPreFlight(ServerHttpRequest request)
@Nullable private RequestMethodsRequestCondition matchRequestMethod(@Nullable java.lang.String httpMethod)
public int compareTo(RequestMethodsRequestCondition other, ServerWebExchange exchange)
It is assumed that both instances have been obtained via
getMatchingCondition(ServerWebExchange)
and therefore each instance
contains the matching HTTP request method only or is otherwise empty.