RequestConditioncontract by delegating to multiple
RequestConditiontypes and using a logical conjunction (
' && ') to ensure all conditions match a given request.
CompositeRequestCondition instances are combined or compared
they are expected to (a) contain the same number of conditions and (b) that
conditions in the respective index are of the same type. It is acceptable to
null conditions or no conditions at all to the constructor.
- Rossen Stoyanchev
Method SummaryModifier and TypeMethodDescriptionIf one instance is empty, return the other.
intIf one instance is empty, the other "wins".Return the underlying conditions (possibly empty but never
protected Collection<?>Return the discrete items a request condition is composed of.Delegate to all contained conditions to match the request and return the resulting "matching" condition instances.
protected StringThe notation to use when printing discrete items of content.
isEmpty()Whether this instance contains 0 conditions or not.
Methods inherited from class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition
equals, hashCode, toString
(RequestCondition<?>... requestConditions)Create an instance with 0 or more
RequestConditiontypes. It is important to create
CompositeRequestConditioninstances with the same number of conditions so they may be compared and combined. It is acceptable to provide
isEmptypublic boolean isEmpty()Whether this instance contains 0 conditions or not.
getConditionsReturn the underlying conditions (possibly empty but never
getContentprotected Collection<?> getContent()Description copied from class:
AbstractRequestConditionReturn the discrete items a request condition is composed of.
For example URL patterns, HTTP request methods, param expressions, etc.
getToStringInfixprotected String getToStringInfix()Description copied from class:
AbstractRequestConditionThe notation to use when printing discrete items of content.
" || "for URL patterns or
" && "for param expressions.
combineIf one instance is empty, return the other. If both instances have conditions, combine the individual conditions after ensuring they are of the same type and number.
other- the condition to combine with.
- a request condition instance that is the result of combining the two condition instances.
getMatchingConditionDelegate to all contained conditions to match the request and return the resulting "matching" condition instances.
CompositeRequestConditionmatches to all requests.
- a condition instance in case of a match or
compareToIf one instance is empty, the other "wins". If both instances have conditions, compare them in the order in which they were provided.