io.alauda.kubernetes.api.model.ProjectSpecBuilder 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 ProjectSpecBuilder extends ProjectSpecFluentImpl implements VisitableBuilder{
ProjectSpecFluent> fluent;
Boolean validationEnabled;
public ProjectSpecBuilder(){
this(true);
}
public ProjectSpecBuilder(Boolean validationEnabled){
this(new ProjectSpec(), validationEnabled);
}
public ProjectSpecBuilder(ProjectSpecFluent> fluent){
this(fluent, true);
}
public ProjectSpecBuilder(ProjectSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new ProjectSpec(), validationEnabled);
}
public ProjectSpecBuilder(ProjectSpecFluent> fluent,ProjectSpec instance){
this(fluent, instance, true);
}
public ProjectSpecBuilder(ProjectSpecFluent> fluent,ProjectSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withNamespaces(instance.getNamespaces());
this.validationEnabled = validationEnabled;
}
public ProjectSpecBuilder(ProjectSpec instance){
this(instance,true);
}
public ProjectSpecBuilder(ProjectSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withNamespaces(instance.getNamespaces());
this.validationEnabled = validationEnabled;
}
public ProjectSpec build(){
ProjectSpec buildable = new ProjectSpec(fluent.getNamespaces());
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;
ProjectSpecBuilder that = (ProjectSpecBuilder) 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;
}
}