01: package liquibase.parser.filter;
02:
03: import liquibase.ChangeSet;
04:
05: public class CountChangeSetFilter implements ChangeSetFilter {
06:
07: private int changeSetsToAllow;
08: private int changeSetsSeen = 0;
09:
10: public CountChangeSetFilter(int changeSetsToAllow) {
11: this .changeSetsToAllow = changeSetsToAllow;
12: }
13:
14: public boolean accepts(ChangeSet changeSet) {
15: changeSetsSeen++;
16: return changeSetsSeen <= changeSetsToAllow;
17: }
18: }
|