io.alauda.kubernetes.api.model.PipelineConfigTemplateBuilder 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 PipelineConfigTemplateBuilder extends PipelineConfigTemplateFluentImpl implements VisitableBuilder{
PipelineConfigTemplateFluent> fluent;
Boolean validationEnabled;
public PipelineConfigTemplateBuilder(){
this(true);
}
public PipelineConfigTemplateBuilder(Boolean validationEnabled){
this(new PipelineConfigTemplate(), validationEnabled);
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplateFluent> fluent){
this(fluent, true);
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplateFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineConfigTemplate(), validationEnabled);
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplateFluent> fluent,PipelineConfigTemplate instance){
this(fluent, instance, true);
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplateFluent> fluent,PipelineConfigTemplate instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withKind(instance.getKind());
fluent.withLabels(instance.getLabels());
fluent.withMetadata(instance.getMetadata());
fluent.withSpec(instance.getSpec());
this.validationEnabled = validationEnabled;
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplate instance){
this(instance,true);
}
public PipelineConfigTemplateBuilder(PipelineConfigTemplate instance,Boolean validationEnabled){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withLabels(instance.getLabels());
this.withMetadata(instance.getMetadata());
this.withSpec(instance.getSpec());
this.validationEnabled = validationEnabled;
}
public PipelineConfigTemplate build(){
PipelineConfigTemplate buildable = new PipelineConfigTemplate(fluent.getApiVersion(),fluent.getKind(),fluent.getLabels(),fluent.getMetadata(),fluent.getSpec());
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;
PipelineConfigTemplateBuilder that = (PipelineConfigTemplateBuilder) 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;
}
}