Class PatternMatchUtils

java.lang.Object
org.springframework.integration.support.utils.PatternMatchUtils

public final class PatternMatchUtils extends Object
Utility methods for pattern matching. This utilities provide support of negative pattern matching as well unlike PatternMatchUtils.
Since:
5.0
Author:
Meherzad Lahewala, Artem Bilan
See Also:
  • Method Details

    • smartMatchIgnoreCase

      public static Boolean smartMatchIgnoreCase(String str, String... patterns)
      Pattern match against the supplied patterns ignoring case; also supports negated ('!') patterns. First match wins (positive or negative). To match the names starting with ! symbol, you have to escape it prepending with the \ symbol in the pattern definition.
      Parameters:
      str - the string to match.
      patterns - the patterns.
      Returns:
      true for positive match; false for negative; null if no pattern matches.
      Since:
      5.0.5
      See Also:
    • smartMatch

      public static Boolean smartMatch(String str, String... patterns)
      Pattern match against the supplied patterns; also supports negated ('!') patterns. First match wins (positive or negative). To match the names starting with ! symbol, you have to escape it prepending with the \ symbol in the pattern definition.
      Parameters:
      str - the string to match.
      patterns - the patterns.
      Returns:
      true for positive match; false for negative; null if no pattern matches.
      See Also: