Creates a new instance with the given destination patterns. Each pattern that is not empty and does not start with "/" is prepended with "/". @param patterns 0 or more URL patterns; if 0 the condition will match to every request.
Alternative constructor accepting a custom PathMatcher. @param patterns the URL patterns to use; if 0, the condition will match to every request. @param pathMatcher the PathMatcher to use
Returns a new instance with URL patterns from the current instance ("this") and the "other" instance as follows: <ul> <li>If there are patterns in both instances, combine the patterns in "this" with the patterns in "other" using {@link hunt.framework.util.PathMatcher#combine(string, string)}. <li>If only one instance has patterns, use them. <li>If neither instance has patterns, use an empty string (i.e. ""). </ul>
Compare the two conditions based on the destination patterns they contain. Patterns are compared one at a time, from top to bottom via {@link hunt.framework.util.PathMatcher#getPatternComparator(string)}. If all compared patterns match equally, but one instance has more patterns, it is considered a closer match. <p>It is assumed that both instances have been obtained via {@link #getMatchingCondition(Message)} to ensure they contain only patterns that match the request and are sorted with the best matches on top.
Check if any of the patterns match the given Message destination and return an instance that is guaranteed to contain matching patterns, sorted via {@link hunt.framework.util.PathMatcher#getPatternComparator(string)}. @param message the message to match to @return the same instance if the condition contains no patterns; or a new condition with sorted matching patterns; or {@code null} either if a destination can not be extracted or there is no match
The name of the "lookup destination" header.
A {@link MessageCondition} for matching the destination of a Message against one or more destination patterns using a {@link PathMatcher}.
@author Rossen Stoyanchev @since 4.0