Class PatternMatchUtils

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

public final class PatternMatchUtils
extends java.lang.Object
Utility methods for pattern matching. This utilities provide support of negative pattern matching as well unlike PatternMatchUtils.
Since:
5.0
See Also:
PatternMatchUtils
  • Method Summary

    Modifier and Type Method Description
    static java.lang.Boolean smartMatch​(java.lang.String str, java.lang.String... patterns)
    Pattern match against the supplied patterns; also supports negated ('!') patterns.
    static java.lang.Boolean smartMatchIgnoreCase​(java.lang.String str, java.lang.String... patterns)
    Pattern match against the supplied patterns ignoring case; also supports negated ('!') patterns.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • smartMatchIgnoreCase

      public static java.lang.Boolean smartMatchIgnoreCase​(java.lang.String str, java.lang.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:
      PatternMatchUtils.simpleMatch(String[], String)
    • smartMatch

      public static java.lang.Boolean smartMatch​(java.lang.String str, java.lang.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:
      PatternMatchUtils.simpleMatch(String[], String)