io.alauda.kubernetes.api.model.CodeRepoServiceSpecBuilder 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 CodeRepoServiceSpecBuilder extends CodeRepoServiceSpecFluentImpl implements VisitableBuilder{
CodeRepoServiceSpecFluent> fluent;
Boolean validationEnabled;
public CodeRepoServiceSpecBuilder(){
this(true);
}
public CodeRepoServiceSpecBuilder(Boolean validationEnabled){
this(new CodeRepoServiceSpec(), validationEnabled);
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpecFluent> fluent){
this(fluent, true);
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new CodeRepoServiceSpec(), validationEnabled);
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpecFluent> fluent,CodeRepoServiceSpec instance){
this(fluent, instance, true);
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpecFluent> fluent,CodeRepoServiceSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withData(instance.getData());
fluent.withHttp(instance.getHttp());
fluent.withPublic(instance.getPublic());
fluent.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpec instance){
this(instance,true);
}
public CodeRepoServiceSpecBuilder(CodeRepoServiceSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withData(instance.getData());
this.withHttp(instance.getHttp());
this.withPublic(instance.getPublic());
this.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public CodeRepoServiceSpec build(){
CodeRepoServiceSpec buildable = new CodeRepoServiceSpec(fluent.getData(),fluent.getHttp(),fluent.isPublic(),fluent.getType());
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;
CodeRepoServiceSpecBuilder that = (CodeRepoServiceSpecBuilder) 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;
}
}