public class DatasetFilterUtils extends Object
| Constructor and Description |
|---|
DatasetFilterUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
filter(List<String> topics,
List<Pattern> blacklist,
List<Pattern> whitelist) |
static Set<String> |
filter(Set<String> topics,
List<Pattern> blacklist,
List<Pattern> whitelist) |
static List<Pattern> |
getPatternList(State state,
String propKey) |
static List<Pattern> |
getPatternList(State state,
String propKey,
String def) |
static List<Pattern> |
getPatternsFromStrings(List<String> strings)
Convert a list of Strings to a list of Patterns.
|
static boolean |
stringInPatterns(String s,
List<Pattern> patterns)
Determines whether a string matches one of the regex patterns.
|
static boolean |
survived(String topic,
List<Pattern> blacklist,
List<Pattern> whitelist)
A topic survives if (1) it doesn't match the blacklist, and
(2) either whitelist is empty, or it matches the whitelist.
|
public static List<Pattern> getPatternsFromStrings(List<String> strings)
public static List<String> filter(List<String> topics, List<Pattern> blacklist, List<Pattern> whitelist)
public static Set<String> filter(Set<String> topics, List<Pattern> blacklist, List<Pattern> whitelist)
public static boolean survived(String topic, List<Pattern> blacklist, List<Pattern> whitelist)