moxproxy.builders.CollectionBuilder Maven / Gradle / Ivy
package moxproxy.builders;
import java.util.ArrayList;
import java.util.List;
public abstract class CollectionBuilder extends BaseBuilder {
private List items;
CollectionBuilder(Parent parent, Validator validator){
super(parent, validator);
items = new ArrayList<>();
}
ChildBuilder addItem(){
ChildBuilder newChild = createChildBuilder();
items.add(newChild);
return newChild;
}
List getItems(){
return items;
}
protected abstract ChildBuilder createChildBuilder();
}