类 SimpMessageTypeMessageCondition
- java.lang.Object
- org.springframework.messaging.handler.AbstractMessageCondition<SimpMessageTypeMessageCondition>
- org.springframework.messaging.simp.SimpMessageTypeMessageCondition
public class SimpMessageTypeMessageCondition extends AbstractMessageCondition<SimpMessageTypeMessageCondition>
A message condition that checks the message type.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static SimpMessageTypeMessageCondition
MESSAGE
static SimpMessageTypeMessageCondition
SUBSCRIBE
构造器概要
构造器 构造器 说明 SimpMessageTypeMessageCondition(SimpMessageType messageType)
A constructor accepting a message type.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 SimpMessageTypeMessageCondition
combine(SimpMessageTypeMessageCondition other)
Define 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<?>
getContent()
Return the collection of objects the message condition is composed of (e.g. destination patterns), nevernull
.SimpMessageTypeMessageCondition
getMatchingCondition(Message<?> message)
Check if this condition matches the given Message and returns a potentially new condition with content tailored to the current message.SimpMessageType
getMessageType()
protected String
getToStringInfix()
The notation to use when printing discrete items of content.从类继承的方法 org.springframework.messaging.handler.AbstractMessageCondition
equals, hashCode, toString
字段详细资料
MESSAGE
public static final SimpMessageTypeMessageCondition MESSAGE
SUBSCRIBE
public static final SimpMessageTypeMessageCondition SUBSCRIBE
构造器详细资料
SimpMessageTypeMessageCondition
public SimpMessageTypeMessageCondition(SimpMessageType messageType)
A constructor accepting a message type.- 参数:
messageType
- the message type to match messages to
方法详细资料
getMessageType
public SimpMessageType getMessageType()
getContent
protected Collection<?> getContent()
从类复制的说明:AbstractMessageCondition
Return the collection of objects the message condition is composed of (e.g. destination patterns), nevernull
.
getToStringInfix
protected String getToStringInfix()
从类复制的说明:AbstractMessageCondition
The notation to use when printing discrete items of content. For example " || " for URL patterns or " && " for param expressions.
combine
public SimpMessageTypeMessageCondition combine(SimpMessageTypeMessageCondition other)
从接口复制的说明:MessageCondition
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
public SimpMessageTypeMessageCondition getMatchingCondition(Message<?> message)
从接口复制的说明: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.- 返回:
- a condition instance in case of a match; or
null
if there is no match.
compareTo
public int compareTo(SimpMessageTypeMessageCondition other, Message<?> message)
从接口复制的说明: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.