@Test public void testFileExistPredicatorCreation() throws IOException { Predicator predicator = PredicatorFactory.newPredicateInstance(createFileExistPredicate()); assertNotNull(predicator); assertTrue(predicator instanceof FileExistPredicator); }
public static Predicator newPredicateInstance(SegmentPredicate segPredicate) { Predicator predicate; switch (segPredicate.getType()) { case "file.exist": predicate = new FileExistPredicator(segPredicate); break; case "custom": predicate = getPredicateBean(segPredicate); break; default: throw new GriffinException.NotFoundException(PREDICATE_TYPE_NOT_FOUND); } return predicate; }
PredicatorFactory { public static Predicator newPredicateInstance(SegmentPredicate segPredicate) { Predicator predicate; switch (segPredicate.getType()) { case "file.exist": predicate = new FileExistPredicator(segPredicate); break; case "custom": predicate = getPredicateBean(segPredicate); break; default: throw new GriffinException.NotFoundException(PREDICATE_TYPE_NOT_FOUND); } return predicate; } }
PredicatorFactory { public static Predicator newPredicateInstance(SegmentPredicate segPredicate) { Predicator predicate; switch (segPredicate.getType()) { case "file.exist": predicate = new FileExistPredicator(segPredicate); break; case "custom": predicate = getPredicateBean(segPredicate); break; default: throw new GriffinException.NotFoundException(PREDICATE_TYPE_NOT_FOUND); } return predicate; }  }
PredicatorFactory { public static Predicator newPredicateInstance(SegmentPredicate segPredicate) { Predicator predicate; switch (segPredicate.getType()) { case "file.exist": predicate = new FileExistPredicator(segPredicate); break; case "custom": predicate = getPredicateBean(segPredicate); break; default: throw new GriffinException.NotFoundException(PREDICATE_TYPE_NOT_FOUND); } return predicate; }  static Predicator newPredicateInstance(SegmentPredicate segPredicate); }
PredicatorFactory { public static Predicator newPredicateInstance(SegmentPredicate segPredicate) { Predicator predicate; switch (segPredicate.getType()) { case "file.exist": predicate = new FileExistPredicator(segPredicate); break; case "custom": predicate = getPredicateBean(segPredicate); break; default: throw new GriffinException.NotFoundException(PREDICATE_TYPE_NOT_FOUND); } return predicate; }  static Predicator newPredicateInstance(SegmentPredicate segPredicate);  }