spring-framework / org.springframework.messaging.handler / MessageCondition

MessageCondition

interface MessageCondition<T : Any>

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.

Parameters

- the kind of condition that this condition can be combined with or compared to

Author
Rossen Stoyanchev

Since
4.0

Functions

combine

abstract fun combine(other: T): T

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

compareTo

abstract fun compareTo(other: T, message: Message<*>): Int

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.

getMatchingCondition

abstract fun getMatchingCondition(message: Message<*>): T

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.

Inheritors

SimpMessageMappingInfo

open class SimpMessageMappingInfo : MessageCondition<SimpMessageMappingInfo>

Encapsulates the following request mapping conditions:

  1. SimpMessageTypeMessageCondition
  2. DestinationPatternsMessageCondition