Class RequestMethodsRequestCondition
java.lang.Object
org.springframework.web.reactive.result.condition.AbstractRequestCondition<RequestMethodsRequestCondition>
org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition
- All Implemented Interfaces:
- RequestCondition<RequestMethodsRequestCondition>
public final class RequestMethodsRequestCondition
extends AbstractRequestCondition<RequestMethodsRequestCondition>
A logical disjunction (' || ') request condition that matches a request
against a set of 
RequestMethods.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionRequestMethodsRequestCondition(RequestMethod... requestMethods) Create a new instance with the given request methods.
- 
Method SummaryModifier and TypeMethodDescriptionReturns a new instance with a union of the HTTP request methods from "this" and the "other" instance.intcompareTo(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'tprotected Collection<RequestMethod> Return the discrete items a request condition is composed of.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.Returns allRequestMethodscontained in this condition.protected StringThe notation to use when printing discrete items of content.Methods inherited from class AbstractRequestConditionequals, hashCode, isEmpty, toString
- 
Constructor Details- 
RequestMethodsRequestConditionCreate a new instance with the given request methods.- Parameters:
- requestMethods- 0 or more HTTP request methods; if, 0 the condition will match to every request
 
 
- 
- 
Method Details- 
getMethodsReturns allRequestMethodscontained in this condition.
- 
getContentDescription copied from class:AbstractRequestConditionReturn the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc. - Specified by:
- getContentin class- AbstractRequestCondition<RequestMethodsRequestCondition>
- Returns:
- a collection of objects (never null)
 
- 
getToStringInfixDescription copied from class:AbstractRequestConditionThe notation to use when printing discrete items of content.For example " || "for URL patterns or" && "for param expressions.- Specified by:
- getToStringInfixin class- AbstractRequestCondition<RequestMethodsRequestCondition>
 
- 
combineReturns a new instance with a union of the HTTP request methods from "this" and the "other" instance.- Parameters:
- other- the condition to combine with.
- Returns:
- a request condition instance that is the result of combining the two condition instances.
 
- 
getMatchingConditionCheck if any of the HTTP request methods match the given request and return an instance that contains the matching HTTP request method only.- Parameters:
- exchange- the current exchange
- Returns:
- 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.
 
- 
compareToReturns:- 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(ServerWebExchange)and therefore each instance contains the matching HTTP request method only or is otherwise empty.
 
-