io.alauda.kubernetes.api.model.PipelineSourceBuilder 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 PipelineSourceBuilder extends PipelineSourceFluentImpl implements VisitableBuilder{
PipelineSourceFluent> fluent;
Boolean validationEnabled;
public PipelineSourceBuilder(){
this(true);
}
public PipelineSourceBuilder(Boolean validationEnabled){
this(new PipelineSource(), validationEnabled);
}
public PipelineSourceBuilder(PipelineSourceFluent> fluent){
this(fluent, true);
}
public PipelineSourceBuilder(PipelineSourceFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineSource(), validationEnabled);
}
public PipelineSourceBuilder(PipelineSourceFluent> fluent,PipelineSource instance){
this(fluent, instance, true);
}
public PipelineSourceBuilder(PipelineSourceFluent> fluent,PipelineSource instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withCodeRepository(instance.getCodeRepository());
fluent.withGit(instance.getGit());
fluent.withSecret(instance.getSecret());
fluent.withSourceType(instance.getSourceType());
fluent.withSvn(instance.getSvn());
this.validationEnabled = validationEnabled;
}
public PipelineSourceBuilder(PipelineSource instance){
this(instance,true);
}
public PipelineSourceBuilder(PipelineSource instance,Boolean validationEnabled){
this.fluent = this;
this.withCodeRepository(instance.getCodeRepository());
this.withGit(instance.getGit());
this.withSecret(instance.getSecret());
this.withSourceType(instance.getSourceType());
this.withSvn(instance.getSvn());
this.validationEnabled = validationEnabled;
}
public PipelineSource build(){
PipelineSource buildable = new PipelineSource(fluent.getCodeRepository(),fluent.getGit(),fluent.getSecret(),fluent.getSourceType(),fluent.getSvn());
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;
PipelineSourceBuilder that = (PipelineSourceBuilder) 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;
}
}