io.alauda.kubernetes.api.model.CodeRepositorySpecBuilder 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 CodeRepositorySpecBuilder extends CodeRepositorySpecFluentImpl implements VisitableBuilder{
CodeRepositorySpecFluent> fluent;
Boolean validationEnabled;
public CodeRepositorySpecBuilder(){
this(true);
}
public CodeRepositorySpecBuilder(Boolean validationEnabled){
this(new CodeRepositorySpec(), validationEnabled);
}
public CodeRepositorySpecBuilder(CodeRepositorySpecFluent> fluent){
this(fluent, true);
}
public CodeRepositorySpecBuilder(CodeRepositorySpecFluent> fluent,Boolean validationEnabled){
this(fluent, new CodeRepositorySpec(), validationEnabled);
}
public CodeRepositorySpecBuilder(CodeRepositorySpecFluent> fluent,CodeRepositorySpec instance){
this(fluent, instance, true);
}
public CodeRepositorySpecBuilder(CodeRepositorySpecFluent> fluent,CodeRepositorySpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withCodeRepoBinding(instance.getCodeRepoBinding());
fluent.withRepository(instance.getRepository());
this.validationEnabled = validationEnabled;
}
public CodeRepositorySpecBuilder(CodeRepositorySpec instance){
this(instance,true);
}
public CodeRepositorySpecBuilder(CodeRepositorySpec instance,Boolean validationEnabled){
this.fluent = this;
this.withCodeRepoBinding(instance.getCodeRepoBinding());
this.withRepository(instance.getRepository());
this.validationEnabled = validationEnabled;
}
public CodeRepositorySpec build(){
CodeRepositorySpec buildable = new CodeRepositorySpec(fluent.getCodeRepoBinding(),fluent.getRepository());
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;
CodeRepositorySpecBuilder that = (CodeRepositorySpecBuilder) 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;
}
}