Class CompositeRequestCondition
java.lang.Object
org.springframework.web.reactive.result.condition.AbstractRequestCondition<CompositeRequestCondition>
org.springframework.web.reactive.result.condition.CompositeRequestCondition
- All Implemented Interfaces:
- RequestCondition<CompositeRequestCondition>
Implements the 
RequestCondition contract by delegating to multiple
 RequestCondition types and using a logical conjunction (' && ') to
 ensure all conditions match a given request.
 When CompositeRequestCondition instances are combined or compared
 is expected that (a) they contain the same number of conditions and (b)
 conditions at the same index are of the same type. It is acceptable to
 provide null conditions or no conditions at all to the constructor.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionCompositeRequestCondition(RequestCondition<?>... requestConditions) Create an instance with 0 or moreRequestConditiontypes.
- 
Method SummaryModifier and TypeMethodDescriptioncombine(CompositeRequestCondition other) If one instance is empty, return the other.intcompareTo(CompositeRequestCondition other, ServerWebExchange exchange) If one instance is empty, the other "wins".Return the underlying conditions, possibly empty but nevernull.protected Collection<? extends @Nullable Object> Return the discrete items a request condition is composed of.getMatchingCondition(ServerWebExchange exchange) 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.booleanisEmpty()Whether this instance contains 0 conditions or not.Methods inherited from class org.springframework.web.reactive.result.condition.AbstractRequestConditionequals, hashCode, toString
- 
Constructor Details- 
CompositeRequestConditionCreate an instance with 0 or moreRequestConditiontypes. It is important to createCompositeRequestConditioninstances with the same number of conditions so they may be compared and combined. It is acceptable to providenullconditions.
 
- 
- 
Method Details- 
isEmptypublic boolean isEmpty()Whether this instance contains 0 conditions or not.- Overrides:
- isEmptyin class- AbstractRequestCondition<CompositeRequestCondition>
- Returns:
- trueif empty;- falseotherwise
 
- 
getConditionsReturn the underlying conditions, possibly empty but nevernull.
- 
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<CompositeRequestCondition>
- 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<CompositeRequestCondition>
 
- 
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. - Parameters:
- other- the condition to combine with.
- Returns:
- 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.An empty CompositeRequestConditionmatches to all requests.- Returns:
- a condition instance in case of a match or nullotherwise.
 
- 
compareToIf one instance is empty, the other "wins". If both instances have conditions, compare them in the order in which they were provided.
 
-