Class PatternMatchUtils

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

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

    • smartMatchIgnoreCase

      @Contract("null, _ -> null; _, null -> null") public static @Nullable Boolean smartMatchIgnoreCase(@Nullable String str, String @Nullable ... patterns)
      Pattern match against the supplied patterns ignoring a 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 a positive match; false for a negative; null if no pattern matches.
      Since:
      5.0.5
      See Also:
    • smartMatch

      @Contract("_, null -> null") public static @Nullable Boolean smartMatch(@Nullable String str, String @Nullable ... 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 a positive match; false for a negative; null if no pattern matches.
      See Also: