io.alauda.kubernetes.api.model.PipelineParameterBuilder 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 PipelineParameterBuilder extends PipelineParameterFluentImpl implements VisitableBuilder{
PipelineParameterFluent> fluent;
Boolean validationEnabled;
public PipelineParameterBuilder(){
this(true);
}
public PipelineParameterBuilder(Boolean validationEnabled){
this(new PipelineParameter(), validationEnabled);
}
public PipelineParameterBuilder(PipelineParameterFluent> fluent){
this(fluent, true);
}
public PipelineParameterBuilder(PipelineParameterFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineParameter(), validationEnabled);
}
public PipelineParameterBuilder(PipelineParameterFluent> fluent,PipelineParameter instance){
this(fluent, instance, true);
}
public PipelineParameterBuilder(PipelineParameterFluent> fluent,PipelineParameter instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withDescription(instance.getDescription());
fluent.withName(instance.getName());
fluent.withType(instance.getType());
fluent.withValue(instance.getValue());
this.validationEnabled = validationEnabled;
}
public PipelineParameterBuilder(PipelineParameter instance){
this(instance,true);
}
public PipelineParameterBuilder(PipelineParameter instance,Boolean validationEnabled){
this.fluent = this;
this.withDescription(instance.getDescription());
this.withName(instance.getName());
this.withType(instance.getType());
this.withValue(instance.getValue());
this.validationEnabled = validationEnabled;
}
public PipelineParameter build(){
PipelineParameter buildable = new PipelineParameter(fluent.getDescription(),fluent.getName(),fluent.getType(),fluent.getValue());
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;
PipelineParameterBuilder that = (PipelineParameterBuilder) 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;
}
}