T
- the type of objects that this RequestCondition can be combined
with and compared topublic interface RequestCondition<T>
Request conditions can be combined via combine(Object)
, matched to
a request via getMatchingCondition(ServerWebExchange)
, and compared
to each other via compareTo(Object, ServerWebExchange)
to determine
which is a closer match for a given request.
Modifier and Type | Method and Description |
---|---|
T |
combine(T other)
Combine this condition with another such as conditions from a
type-level and method-level
@RequestMapping annotation. |
int |
compareTo(T other,
ServerWebExchange exchange)
Compare this condition to another condition in the context of
a specific request.
|
T |
getMatchingCondition(ServerWebExchange exchange)
Check if the condition matches the request returning a potentially new
instance created for the current request.
|
T combine(T other)
@RequestMapping
annotation.other
- the condition to combine with.@Nullable T getMatchingCondition(ServerWebExchange exchange)
For CORS pre-flight requests, conditions should match to the would-be, actual request (e.g. URL pattern, query parameters, and the HTTP method from the "Access-Control-Request-Method" header). If a condition cannot be matched to a pre-flight request it should return an instance with empty content thus not causing a failure to match.
null
otherwise.int compareTo(T other, ServerWebExchange exchange)
getMatchingCondition(ServerWebExchange)
to ensure they have content relevant to current request only.