public class SearchTools extends Object
Modifier and Type | Field and Description |
---|---|
protected static Map |
regexPatternCache |
Constructor and Description |
---|
SearchTools() |
Modifier and Type | Method and Description |
---|---|
static Pattern |
buildPatternForTerm(String term)
Convert the search term to a regex pattern.
|
static Pattern |
buildPatternForTerm(String term,
int flags)
Convert the search term to a regex pattern.
|
static String |
buildRegExForTerm(String term)
Convert the search term to a regex string.
|
static List |
buildRegExForTerms(List terms)
Convert the search term list to a list of regex patterns.
|
static List |
buildRegExForTerms(List terms,
int flags)
Convert the search term list to a list of regex patterns.
|
static boolean |
matchesAllRegExPatterns(String value,
List patternList)
Check if the given string matches all the regex patterns in
the pattern list
|
protected static Map regexPatternCache
public static List buildRegExForTerms(List terms)
terms
- list of search termspublic static List buildRegExForTerms(List terms, int flags)
terms
- list of search termsflags
- flags to use for the pattern objectpublic static String buildRegExForTerm(String term)
term
- the search termpublic static Pattern buildPatternForTerm(String term)
term
- the search termpublic static Pattern buildPatternForTerm(String term, int flags)
term
- the search termflags
- flags to use for the pattern objectpublic static boolean matchesAllRegExPatterns(String value, List patternList)
value
- the string to match againstpatternList
- the list of regex patterns to match