Top Description Methods
org.springframework.messaging.handler

public Interface MessageCondition<T>

Known Direct Implementers
org.springframework.messaging.simp.SimpMessageMappingInfo, org.springframework.messaging.handler.AbstractMessageCondition, org.springframework.messaging.handler.CompositeMessageCondition
Type Parameters
<T>
the kind of condition that this condition can be combined with or compared to
Imports
org.springframework.lang.Nullable, org.springframework.messaging.Message

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.

Author
Rossen Stoyanchev
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the resulting message condition
combine
(T
the condition to combine with
other
)

Define the rules for combining this condition with another.

public int
compareTo(T other, Message<?> message)

Compare this condition to another in the context of a specific message.

public T

Returns:

a condition instance in case of a match; or null if there is no match.
getMatchingCondition
(Message<?> message)

Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.

Method Detail

combineback to summary
public T combine(T other)

Define the rules for combining this condition with another. For example combining type- and method-level conditions.

Parameters
other:T

the condition to combine with

Returns:T

the resulting message condition

compareToback to summary
public 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 via getMatchingCondition(Message) to ensure they have content relevant to current message only.

getMatchingConditionback to summary
public 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.

Returns:T

a condition instance in case of a match; or null if there is no match.

Annotations
@Nullable