Class SimpMessageTypeMessageCondition
java.lang.Object
org.springframework.messaging.handler.AbstractMessageCondition<SimpMessageTypeMessageCondition>
org.springframework.messaging.simp.SimpMessageTypeMessageCondition
- All Implemented Interfaces:
MessageCondition<SimpMessageTypeMessageCondition>
public class SimpMessageTypeMessageCondition
extends AbstractMessageCondition<SimpMessageTypeMessageCondition>
MessageCondition
that matches by the message type obtained via
SimpMessageHeaderAccessor.getMessageType(Map)
.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SimpMessageTypeMessageCondition
static final SimpMessageTypeMessageCondition
-
Constructor Summary
ConstructorDescriptionSimpMessageTypeMessageCondition
(SimpMessageType messageType) A constructor accepting a message type. -
Method Summary
Modifier and TypeMethodDescriptionDefine the rules for combining this condition with another.int
compareTo
(SimpMessageTypeMessageCondition other, Message<?> message) Compare this condition to another in the context of a specific message.protected Collection<?>
Return the collection of objects the message condition is composed of (e.g.getMatchingCondition
(Message<?> message) Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.protected String
The notation to use when printing discrete items of content.Methods inherited from class org.springframework.messaging.handler.AbstractMessageCondition
equals, hashCode, toString
-
Field Details
-
MESSAGE
-
SUBSCRIBE
-
-
Constructor Details
-
SimpMessageTypeMessageCondition
A constructor accepting a message type.- Parameters:
messageType
- the message type to match messages to
-
-
Method Details
-
getMessageType
-
getContent
Description copied from class:AbstractMessageCondition
Return the collection of objects the message condition is composed of (e.g. destination patterns), nevernull
.- Specified by:
getContent
in classAbstractMessageCondition<SimpMessageTypeMessageCondition>
-
getToStringInfix
Description copied from class:AbstractMessageCondition
The notation to use when printing discrete items of content. For example " || " for URL patterns or " && " for param expressions.- Specified by:
getToStringInfix
in classAbstractMessageCondition<SimpMessageTypeMessageCondition>
-
combine
Description copied from interface:MessageCondition
Define the rules for combining this condition with another. For example combining type- and method-level conditions.- Parameters:
other
- the condition to combine with- Returns:
- the resulting message condition
-
getMatchingCondition
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.- Returns:
- a condition instance in case of a match; or
null
if there is no match.
-
compareTo
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.
-