接口 MessageCondition<T>
- 类型参数:
T
- the kind of condition that this condition can be combined with or compared to
- 所有已知实现类:
AbstractMessageCondition
,CompositeMessageCondition
,DestinationPatternsMessageCondition
,RSocketFrameTypeMessageCondition
,SimpMessageMappingInfo
,SimpMessageTypeMessageCondition
public interface MessageCondition<T>
Contract for mapping conditions to messages.Message conditions can be combined (e.g. type + method-level conditions), matched to a specific Message, as well as compared to each other in the context of a Message to determine which one matches a request more closely.
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 T
combine(T other)
Define the rules for combining this condition with another.int
compareTo(T other, Message<?> message)
Compare this condition to another in the context of a specific message.T
getMatchingCondition(Message<?> message)
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.
方法详细资料
combine
T combine(T other)
Define the rules for combining this condition with another. For example combining type- and method-level conditions.- 参数:
other
- the condition to combine with- 返回:
- the resulting message condition
getMatchingCondition
@Nullable T getMatchingCondition(Message<?> message)
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.- 返回:
- a condition instance in case of a match; or
null
if there is no match.
compareTo
int compareTo(T other, Message<?> message)
Compare this condition to another in the context of a specific message. It is assumed both instances have been obtained viagetMatchingCondition(Message)
to ensure they have content relevant to current message only.