annotations.me.snowdrop.applicationcrd.api.model.ApplicationSpecBuilder Maven / Gradle / Ivy
package me.snowdrop.applicationcrd.api.model;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;
public class ApplicationSpecBuilder extends ApplicationSpecFluentImpl implements VisitableBuilder{
ApplicationSpecFluent> fluent;
Boolean validationEnabled;
Validator validator;
public ApplicationSpecBuilder(){
this(true);
}
public ApplicationSpecBuilder(Boolean validationEnabled){
this(new ApplicationSpec(), validationEnabled);
}
public ApplicationSpecBuilder(ApplicationSpecFluent> fluent){
this(fluent, true);
}
public ApplicationSpecBuilder(ApplicationSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new ApplicationSpec(), validationEnabled);
}
public ApplicationSpecBuilder(ApplicationSpecFluent> fluent,ApplicationSpec instance){
this(fluent, instance, true);
}
public ApplicationSpecBuilder(ApplicationSpecFluent> fluent,ApplicationSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAssemblyPhase(instance.getAssemblyPhase());
fluent.withComponentKinds(instance.getComponentKinds());
fluent.withDescriptor(instance.getDescriptor());
fluent.withInfo(instance.getInfo());
fluent.withSelector(instance.getSelector());
this.validationEnabled = validationEnabled;
}
public ApplicationSpecBuilder(ApplicationSpec instance){
this(instance,true);
}
public ApplicationSpecBuilder(ApplicationSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withAssemblyPhase(instance.getAssemblyPhase());
this.withComponentKinds(instance.getComponentKinds());
this.withDescriptor(instance.getDescriptor());
this.withInfo(instance.getInfo());
this.withSelector(instance.getSelector());
this.validationEnabled = validationEnabled;
}
public ApplicationSpecBuilder(Validator validator){
this(new ApplicationSpec(), true);
}
public ApplicationSpecBuilder(ApplicationSpecFluent> fluent,ApplicationSpec instance,Validator validator){
this.fluent = fluent;
fluent.withAssemblyPhase(instance.getAssemblyPhase());
fluent.withComponentKinds(instance.getComponentKinds());
fluent.withDescriptor(instance.getDescriptor());
fluent.withInfo(instance.getInfo());
fluent.withSelector(instance.getSelector());
this.validator = validator;
this.validationEnabled = validator != null;
}
public ApplicationSpecBuilder(ApplicationSpec instance,Validator validator){
this.fluent = this;
this.withAssemblyPhase(instance.getAssemblyPhase());
this.withComponentKinds(instance.getComponentKinds());
this.withDescriptor(instance.getDescriptor());
this.withInfo(instance.getInfo());
this.withSelector(instance.getSelector());
this.validator = validator;
this.validationEnabled = validator != null;
}
public ApplicationSpec build(){
ApplicationSpec buildable = new ApplicationSpec(fluent.getAssemblyPhase(),fluent.getComponentKinds(),fluent.getDescriptor(),fluent.getInfo(),fluent.getSelector());
if (validationEnabled) {io.fabric8.kubernetes.api.builder.ValidationUtils.validate(buildable, validator);}
return buildable;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ApplicationSpecBuilder that = (ApplicationSpecBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy