All Downloads are FREE. Search and download functionalities are using the official Maven repository.

moxproxy.builders.BaseBuilder Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package moxproxy.builders;

import moxproxy.exceptions.BuilderValidationException;

public abstract class BaseBuilder implements Builder {

    private Parent parent;
    private Validator validator;

    BaseBuilder(Parent parent, Validator validator){
        this.parent = parent;
        this.validator = validator;
    }

    @Override
    public Parent backToParent() {
        return parent;
    }

    @Override
    public Model build() {
        BuilderImplementation builder = getCurrentBuilder();
        validator.performValidation(builder);
        return performBuild();
    }

    protected abstract Model performBuild() throws BuilderValidationException;

    protected abstract BuilderImplementation getCurrentBuilder();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy