Class ParamsRequestCondition
java.lang.Object
org.springframework.web.reactive.result.condition.AbstractRequestCondition<ParamsRequestCondition>
org.springframework.web.reactive.result.condition.ParamsRequestCondition
- All Implemented Interfaces:
RequestCondition<ParamsRequestCondition>
A logical conjunction (
' && '
) request condition that matches a request against
a set parameter expressions with syntax defined in RequestMapping.params()
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionParamsRequestCondition
(String... params) Create a new instance from the given param expressions. -
Method Summary
Modifier and TypeMethodDescriptioncombine
(ParamsRequestCondition other) Returns a new instance with the union of the param expressions from "this" and the "other" instance.int
compareTo
(ParamsRequestCondition other, ServerWebExchange exchange) Compare to another condition based on parameter expressions.protected Collection<org.springframework.web.reactive.result.condition.ParamsRequestCondition.ParamExpression>
Return the discrete items a request condition is composed of.Return the contained request parameter expressions.getMatchingCondition
(ServerWebExchange exchange) Returns "this" instance if the request matches all param expressions; ornull
otherwise.protected String
The notation to use when printing discrete items of content.Methods inherited from class org.springframework.web.reactive.result.condition.AbstractRequestCondition
equals, hashCode, isEmpty, toString
-
Constructor Details
-
ParamsRequestCondition
Create a new instance from the given param expressions.- Parameters:
params
- expressions with syntax defined inRequestMapping.params()
; if 0, the condition will match to every request.
-
-
Method Details
-
getExpressions
Return the contained request parameter expressions. -
getContent
protected Collection<org.springframework.web.reactive.result.condition.ParamsRequestCondition.ParamExpression> getContent()Description copied from class:AbstractRequestCondition
Return the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- Specified by:
getContent
in classAbstractRequestCondition<ParamsRequestCondition>
- Returns:
- a collection of objects (never
null
)
-
getToStringInfix
Description copied from class:AbstractRequestCondition
The notation to use when printing discrete items of content.For example
" || "
for URL patterns or" && "
for param expressions.- Specified by:
getToStringInfix
in classAbstractRequestCondition<ParamsRequestCondition>
-
combine
Returns a new instance with the union of the param expressions 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.
-
getMatchingCondition
Returns "this" instance if the request matches all param expressions; ornull
otherwise.- Returns:
- a condition instance in case of a match or
null
otherwise.
-
compareTo
Compare to another condition based on parameter expressions. A condition is considered to be a more specific match, if it has:- A greater number of expressions.
- A greater number of non-negated expressions with a concrete value.
It is assumed that both instances have been obtained via
getMatchingCondition(ServerWebExchange)
and each instance contains the matching parameter expressions only or is otherwise empty.
-