io.alauda.kubernetes.api.model.apiextensions.CustomResourceDefinitionSpecBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model.apiextensions;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class CustomResourceDefinitionSpecBuilder extends CustomResourceDefinitionSpecFluentImpl implements VisitableBuilder{
CustomResourceDefinitionSpecFluent> fluent;
Boolean validationEnabled;
public CustomResourceDefinitionSpecBuilder(){
this(true);
}
public CustomResourceDefinitionSpecBuilder(Boolean validationEnabled){
this(new CustomResourceDefinitionSpec(), validationEnabled);
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpecFluent> fluent){
this(fluent, true);
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new CustomResourceDefinitionSpec(), validationEnabled);
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpecFluent> fluent,CustomResourceDefinitionSpec instance){
this(fluent, instance, true);
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpecFluent> fluent,CustomResourceDefinitionSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withGroup(instance.getGroup());
fluent.withNames(instance.getNames());
fluent.withScope(instance.getScope());
fluent.withVersion(instance.getVersion());
this.validationEnabled = validationEnabled;
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpec instance){
this(instance,true);
}
public CustomResourceDefinitionSpecBuilder(CustomResourceDefinitionSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withGroup(instance.getGroup());
this.withNames(instance.getNames());
this.withScope(instance.getScope());
this.withVersion(instance.getVersion());
this.validationEnabled = validationEnabled;
}
public CustomResourceDefinitionSpec build(){
CustomResourceDefinitionSpec buildable = new CustomResourceDefinitionSpec(fluent.getGroup(),fluent.getNames(),fluent.getScope(),fluent.getVersion());
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;
CustomResourceDefinitionSpecBuilder that = (CustomResourceDefinitionSpecBuilder) 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;
}
}