@Test public void testIncludeExclude() { TreeSet<Pattern> excludes = new TreeSet<>(PatternFilter.PATTERN_COMPARATOR); excludes.add(Pattern.compile("aaa")); excludes.add(Pattern.compile("bb")); TreeSet<IncludeTableFilter> includes = new TreeSet<>(); includes.add(new IncludeTableFilter("aa.*")); TableFilter filter = new TableFilter(includes, excludes); assertFalse(filter.isIncludeTable("aaa")); assertTrue(filter.isIncludeTable("aa")); assertTrue(filter.isIncludeTable("aaaa")); assertFalse(filter.isIncludeTable("bb")); assertFalse(filter.isIncludeTable("")); assertFalse(filter.isIncludeTable("bbbb")); }
public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; }
TableFilter { public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; } }
TableFilter { public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; } TableFilter(SortedSet<IncludeTableFilter> includes, SortedSet<Pattern> excludes); }
TableFilter { public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; } TableFilter(SortedSet<IncludeTableFilter> includes, SortedSet<Pattern> excludes); boolean isIncludeTable(String tableName); PatternFilter getIncludeTableColumnFilter(String tableName); PatternFilter getIncludeTableRelationshipFilter(String tableName); SortedSet<IncludeTableFilter> getIncludes(); static TableFilter include(String tablePattern); static TableFilter everything(); @Override boolean equals(Object o); @Override int hashCode(); }
TableFilter { public boolean isIncludeTable(String tableName) { PatternFilter columnFilter = getIncludeTableColumnFilter(tableName); return columnFilter != null; } TableFilter(SortedSet<IncludeTableFilter> includes, SortedSet<Pattern> excludes); boolean isIncludeTable(String tableName); PatternFilter getIncludeTableColumnFilter(String tableName); PatternFilter getIncludeTableRelationshipFilter(String tableName); SortedSet<IncludeTableFilter> getIncludes(); static TableFilter include(String tablePattern); static TableFilter everything(); @Override boolean equals(Object o); @Override int hashCode();  }