.add(coreTablesToExclude.toImmutable()); if (excludeObjects != null) { objectExclusionPredicateBuilder = objectExclusionPredicateBuilder.add(ObjectTypeAndNamePredicateBuilder.parse(excludeObjects, ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE));
.add(coreTablesToExclude.toImmutable()); if (excludeObjects != null) { objectExclusionPredicateBuilder = objectExclusionPredicateBuilder.add(ObjectTypeAndNamePredicateBuilder.parse(excludeObjects, ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE));
@Test public void testStringParsing() { ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;-VIEW~view1", null); Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair()); assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude"))); assertTrue(predicate.accept(Tuples.pair("TABLE", "tab1"))); assertTrue(predicate.accept(Tuples.pair("TABLE", "tab2"))); assertFalse(predicate.accept(Tuples.pair("TABLE", "tabNo"))); assertFalse(predicate.accept(Tuples.pair("VIEW", "view1"))); assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude"))); }
@Test public void testStringParsingWithExclusionDefault() { ObjectTypeAndNamePredicateBuilder parse = ObjectTypeAndNamePredicateBuilder.parse("TABLE~tab1,tab2;VIEW~view1", ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE); Predicates<? super Pair<String, String>> predicate = parse.build(Functions.<String>firstOfPair(), (Function<Pair<String, String>, String>) (Function) Functions.<String>secondOfPair()); assertTrue(predicate.accept(Tuples.pair("OTHER", "otherInclude"))); assertFalse(predicate.accept(Tuples.pair("TABLE", "tab1"))); assertFalse(predicate.accept(Tuples.pair("TABLE", "tab2"))); assertTrue(predicate.accept(Tuples.pair("TABLE", "tabNo"))); assertFalse(predicate.accept(Tuples.pair("VIEW", "view1"))); assertTrue(predicate.accept(Tuples.pair("VIEW", "viewInclude"))); } }