io.alauda.kubernetes.api.model.PipelineTaskArgumentBuilder 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 PipelineTaskArgumentBuilder extends PipelineTaskArgumentFluentImpl implements VisitableBuilder{
PipelineTaskArgumentFluent> fluent;
Boolean validationEnabled;
public PipelineTaskArgumentBuilder(){
this(true);
}
public PipelineTaskArgumentBuilder(Boolean validationEnabled){
this(new PipelineTaskArgument(), validationEnabled);
}
public PipelineTaskArgumentBuilder(PipelineTaskArgumentFluent> fluent){
this(fluent, true);
}
public PipelineTaskArgumentBuilder(PipelineTaskArgumentFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineTaskArgument(), validationEnabled);
}
public PipelineTaskArgumentBuilder(PipelineTaskArgumentFluent> fluent,PipelineTaskArgument instance){
this(fluent, instance, true);
}
public PipelineTaskArgumentBuilder(PipelineTaskArgumentFluent> fluent,PipelineTaskArgument instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withDefault(instance.getDefault());
fluent.withDisplay(instance.getDisplay());
fluent.withName(instance.getName());
fluent.withRelation(instance.getRelation());
fluent.withRequired(instance.getRequired());
fluent.withSchema(instance.getSchema());
fluent.withValidation(instance.getValidation());
this.validationEnabled = validationEnabled;
}
public PipelineTaskArgumentBuilder(PipelineTaskArgument instance){
this(instance,true);
}
public PipelineTaskArgumentBuilder(PipelineTaskArgument instance,Boolean validationEnabled){
this.fluent = this;
this.withDefault(instance.getDefault());
this.withDisplay(instance.getDisplay());
this.withName(instance.getName());
this.withRelation(instance.getRelation());
this.withRequired(instance.getRequired());
this.withSchema(instance.getSchema());
this.withValidation(instance.getValidation());
this.validationEnabled = validationEnabled;
}
public PipelineTaskArgument build(){
PipelineTaskArgument buildable = new PipelineTaskArgument(fluent.getDefault(),fluent.getDisplay(),fluent.getName(),fluent.getRelation(),fluent.isRequired(),fluent.getSchema(),fluent.getValidation());
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;
PipelineTaskArgumentBuilder that = (PipelineTaskArgumentBuilder) 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;
}
}