annotations.io.alauda.kubernetes.api.model.ResourceQuotaSpecBuilder 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 ResourceQuotaSpecBuilder extends ResourceQuotaSpecFluentImpl implements VisitableBuilder{
ResourceQuotaSpecFluent> fluent;
Boolean validationEnabled;
public ResourceQuotaSpecBuilder(){
this(true);
}
public ResourceQuotaSpecBuilder(Boolean validationEnabled){
this(new ResourceQuotaSpec(), validationEnabled);
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpecFluent> fluent){
this(fluent, true);
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new ResourceQuotaSpec(), validationEnabled);
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpecFluent> fluent,ResourceQuotaSpec instance){
this(fluent, instance, true);
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpecFluent> fluent,ResourceQuotaSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withHard(instance.getHard());
fluent.withScopes(instance.getScopes());
this.validationEnabled = validationEnabled;
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpec instance){
this(instance,true);
}
public ResourceQuotaSpecBuilder(ResourceQuotaSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withHard(instance.getHard());
this.withScopes(instance.getScopes());
this.validationEnabled = validationEnabled;
}
public ResourceQuotaSpec build(){
ResourceQuotaSpec buildable = new ResourceQuotaSpec(fluent.getHard(),fluent.getScopes());
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;
ResourceQuotaSpecBuilder that = (ResourceQuotaSpecBuilder) 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;
}
}