public class SearchTools extends Object
Modifier and Type | Field and Description |
---|---|
protected static Map<String,Pattern> |
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<Pattern> |
buildRegExForTerms(List<String> terms)
Convert the search term list to a list of regex patterns.
|
static List<Pattern> |
buildRegExForTerms(List<String> terms,
int flags)
Convert the search term list to a list of regex patterns.
|
static boolean |
matchesAllRegExPatterns(String value,
List<Pattern> patternList)
Check if the given string matches all the regex patterns in
the pattern list
|
public static List<Pattern> buildRegExForTerms(List<String> terms)
terms
- list of search termspublic static List<Pattern> buildRegExForTerms(List<String> 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<Pattern> patternList)
value
- the string to match againstpatternList
- the list of regex patterns to match