Package io.jmix.webdavrest.condition
Class WebdavMethodRequestCondition
java.lang.Object
org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebdavMethodRequestCondition>
io.jmix.webdavrest.condition.WebdavMethodRequestCondition
- All Implemented Interfaces:
org.springframework.web.servlet.mvc.condition.RequestCondition<WebdavMethodRequestCondition>
public class WebdavMethodRequestCondition
extends org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebdavMethodRequestCondition>
Inspired by
RequestMethodsRequestCondition-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebdavMethodRequestCondition(WebdavRequestMethod... requestMethods) Create a new instance with the given request methods. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new instance with a union of the HTTP request methods from "this" and the "other" instance.intcompareTo(WebdavMethodRequestCondition other, jakarta.servlet.http.HttpServletRequest 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<WebdavRequestMethod>getMatchingCondition(jakarta.servlet.http.HttpServletRequest 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 allWebdavRequestMethods contained in this condition.protected StringMethods inherited from class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition
equals, hashCode, isEmpty, toString
-
Field Details
-
methods
-
-
Constructor Details
-
WebdavMethodRequestCondition
Create 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
-
getMethods
Returns allWebdavRequestMethods contained in this condition. -
getContent
- Specified by:
getContentin classorg.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebdavMethodRequestCondition>
-
getToStringInfix
- Specified by:
getToStringInfixin classorg.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebdavMethodRequestCondition>
-
combine
Returns a new instance with a union of the HTTP request methods from "this" and the "other" instance. -
getMatchingCondition
public WebdavMethodRequestCondition getMatchingCondition(jakarta.servlet.http.HttpServletRequest 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.- Parameters:
request- the current request- 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.
-
compareTo
public int compareTo(WebdavMethodRequestCondition other, jakarta.servlet.http.HttpServletRequest 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't
It is assumed that both instances have been obtained via
getMatchingCondition(HttpServletRequest)and therefore each instance contains the matching HTTP request method only or is otherwise empty.
-