Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2002-2013 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.springframework.messaging.handler;
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.

<T> The kind of condition that this condition can be combined with or compared to
Rossen Stoyanchev
public interface MessageCondition<T> {

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
combine(T other);

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.
getMatchingCondition(Message<?> message);

Compare this condition to another in the context of a specific message. It is assumed both instances have been obtained via getMatchingCondition(org.springframework.messaging.Message) to ensure they have content relevant to current message only.
	int compareTo(T otherMessage<?> message);
New to GrepCode? Check out our FAQ X