io.alauda.kubernetes.api.model.PipelineTaskTemplateSpecBuilder 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 PipelineTaskTemplateSpecBuilder extends PipelineTaskTemplateSpecFluentImpl implements VisitableBuilder{
PipelineTaskTemplateSpecFluent> fluent;
Boolean validationEnabled;
public PipelineTaskTemplateSpecBuilder(){
this(true);
}
public PipelineTaskTemplateSpecBuilder(Boolean validationEnabled){
this(new PipelineTaskTemplateSpec(), validationEnabled);
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpecFluent> fluent){
this(fluent, true);
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineTaskTemplateSpec(), validationEnabled);
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpecFluent> fluent,PipelineTaskTemplateSpec instance){
this(fluent, instance, true);
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpecFluent> fluent,PipelineTaskTemplateSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAgent(instance.getAgent());
fluent.withArguments(instance.getArguments());
fluent.withBody(instance.getBody());
fluent.withDependencies(instance.getDependencies());
fluent.withEngine(instance.getEngine());
fluent.withExports(instance.getExports());
fluent.withParameters(instance.getParameters());
this.validationEnabled = validationEnabled;
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpec instance){
this(instance,true);
}
public PipelineTaskTemplateSpecBuilder(PipelineTaskTemplateSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withAgent(instance.getAgent());
this.withArguments(instance.getArguments());
this.withBody(instance.getBody());
this.withDependencies(instance.getDependencies());
this.withEngine(instance.getEngine());
this.withExports(instance.getExports());
this.withParameters(instance.getParameters());
this.validationEnabled = validationEnabled;
}
public PipelineTaskTemplateSpec build(){
PipelineTaskTemplateSpec buildable = new PipelineTaskTemplateSpec(fluent.getAgent(),fluent.getArguments(),fluent.getBody(),fluent.getDependencies(),fluent.getEngine(),fluent.getExports(),fluent.getParameters());
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;
PipelineTaskTemplateSpecBuilder that = (PipelineTaskTemplateSpecBuilder) 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;
}
}