io.alauda.kubernetes.api.model.PipelineConfigTemplateSpecBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class PipelineConfigTemplateSpecBuilder extends PipelineConfigTemplateSpecFluentImpl implements VisitableBuilder{
PipelineConfigTemplateSpecFluent> fluent;
Boolean validationEnabled;
public PipelineConfigTemplateSpecBuilder(){
this(true);
}
public PipelineConfigTemplateSpecBuilder(Boolean validationEnabled){
this(new PipelineConfigTemplateSpec(), validationEnabled);
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpecFluent> fluent){
this(fluent, true);
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineConfigTemplateSpec(), validationEnabled);
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpecFluent> fluent,PipelineConfigTemplateSpec instance){
this(fluent, instance, true);
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpecFluent> fluent,PipelineConfigTemplateSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAgent(instance.getAgent());
fluent.withArguments(instance.getArguments());
fluent.withDependencies(instance.getDependencies());
fluent.withEngine(instance.getEngine());
fluent.withEnvironments(instance.getEnvironments());
fluent.withParameters(instance.getParameters());
fluent.withStages(instance.getStages());
fluent.withWithSCM(instance.getWithSCM());
this.validationEnabled = validationEnabled;
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpec instance){
this(instance,true);
}
public PipelineConfigTemplateSpecBuilder(PipelineConfigTemplateSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withAgent(instance.getAgent());
this.withArguments(instance.getArguments());
this.withDependencies(instance.getDependencies());
this.withEngine(instance.getEngine());
this.withEnvironments(instance.getEnvironments());
this.withParameters(instance.getParameters());
this.withStages(instance.getStages());
this.withWithSCM(instance.getWithSCM());
this.validationEnabled = validationEnabled;
}
public PipelineConfigTemplateSpec build(){
PipelineConfigTemplateSpec buildable = new PipelineConfigTemplateSpec(fluent.getAgent(),fluent.getArguments(),fluent.getDependencies(),fluent.getEngine(),fluent.getEnvironments(),fluent.getParameters(),fluent.getStages(),fluent.isWithSCM());
io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
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;
PipelineConfigTemplateSpecBuilder that = (PipelineConfigTemplateSpecBuilder) 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;
}
}