Package org.springframework.util
Class PatternMatchUtils
java.lang.Object
org.springframework.util.PatternMatchUtils
Utility methods for simple pattern matching, in particular for Spring's typical
 
xxx*, *xxx, *xxx*, and xxx*yyy pattern styles.- Since:
- 2.0
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleansimpleMatch(String[] patterns, String str) Match a String against the given patterns, supporting direct equality as well as the following simple pattern styles:xxx*,*xxx,*xxx*, andxxx*yyy(with an arbitrary number of pattern parts).static booleansimpleMatch(String pattern, String str) Match a String against the given pattern, supporting direct equality as well as the following simple pattern styles:xxx*,*xxx,*xxx*, andxxx*yyy(with an arbitrary number of pattern parts).static booleansimpleMatchIgnoreCase(String[] patterns, String str) Variant ofsimpleMatch(String[], String)that ignores upper/lower case.static booleansimpleMatchIgnoreCase(String pattern, String str) Variant ofsimpleMatch(String, String)that ignores upper/lower case.
- 
Constructor Details- 
PatternMatchUtilspublic PatternMatchUtils()
 
- 
- 
Method Details- 
simpleMatchMatch a String against the given pattern, supporting direct equality as well as the following simple pattern styles:xxx*,*xxx,*xxx*, andxxx*yyy(with an arbitrary number of pattern parts).Returns falseif the supplied String or pattern isnull.- Parameters:
- pattern- the pattern to match against
- str- the String to match
- Returns:
- whether the String matches the given pattern
 
- 
simpleMatchIgnoreCaseVariant ofsimpleMatch(String, String)that ignores upper/lower case.- Since:
- 6.1.20
 
- 
simpleMatchMatch a String against the given patterns, supporting direct equality as well as the following simple pattern styles:xxx*,*xxx,*xxx*, andxxx*yyy(with an arbitrary number of pattern parts).Returns falseif the supplied String isnullor if the supplied patterns array isnullor empty.- Parameters:
- patterns- the patterns to match against
- str- the String to match
- Returns:
- whether the String matches any of the given patterns
 
- 
simpleMatchIgnoreCaseVariant ofsimpleMatch(String[], String)that ignores upper/lower case.- Since:
- 6.1.20
 
 
-