Class CompositeMessageCondition
- java.lang.Object
- org.springframework.messaging.handler.CompositeMessageCondition
- All Implemented Interfaces:
MessageCondition<CompositeMessageCondition>
public class CompositeMessageCondition extends Object implements MessageCondition<CompositeMessageCondition>
CompositeMessageCondition
that delegates to other message conditions.For
combine(org.springframework.messaging.handler.CompositeMessageCondition)
andcompareTo(org.springframework.messaging.handler.CompositeMessageCondition, org.springframework.messaging.Message<?>)
it is expected that the "other" composite contains the same number, type, and order of message conditions.- Since:
- 5.2
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description CompositeMessageCondition(MessageCondition<?>... messageConditions)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeMessageCondition
combine(CompositeMessageCondition other)
Define the rules for combining this condition with another.int
compareTo(CompositeMessageCondition other, Message<?> message)
Compare this condition to another in the context of a specific message.boolean
equals(Object other)
<T extends MessageCondition<T>>
TgetCondition(Class<T> messageConditionType)
CompositeMessageCondition
getMatchingCondition(Message<?> message)
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.List<MessageCondition<?>>
getMessageConditions()
int
hashCode()
String
toString()
Constructor Detail
CompositeMessageCondition
public CompositeMessageCondition(MessageCondition<?>... messageConditions)
Method Detail
getMessageConditions
public List<MessageCondition<?>> getMessageConditions()
getCondition
public <T extends MessageCondition<T>> T getCondition(Class<T> messageConditionType)
combine
public CompositeMessageCondition combine(CompositeMessageCondition other)
Description copied from interface:MessageCondition
Define the rules for combining this condition with another. For example combining type- and method-level conditions.- Specified by:
combine
in interfaceMessageCondition<CompositeMessageCondition>
- Parameters:
other
- the condition to combine with- Returns:
- the resulting message condition
getMatchingCondition
public CompositeMessageCondition getMatchingCondition(Message<?> message)
Description copied from interface:MessageCondition
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message. For example a condition with destination patterns might return a new condition with sorted, matching patterns only.- Specified by:
getMatchingCondition
in interfaceMessageCondition<CompositeMessageCondition>
- Returns:
- a condition instance in case of a match; or
null
if there is no match.
compareTo
public int compareTo(CompositeMessageCondition other, Message<?> message)
Description copied from interface:MessageCondition
Compare this condition to another in the context of a specific message. It is assumed both instances have been obtained viaMessageCondition.getMatchingCondition(Message)
to ensure they have content relevant to current message only.- Specified by:
compareTo
in interfaceMessageCondition<CompositeMessageCondition>