io.alauda.kubernetes.api.model.extensions.IngressSpecBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model.extensions;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class IngressSpecBuilder extends IngressSpecFluentImpl implements VisitableBuilder{
IngressSpecFluent> fluent;
Boolean validationEnabled;
public IngressSpecBuilder(){
this(true);
}
public IngressSpecBuilder(Boolean validationEnabled){
this(new IngressSpec(), validationEnabled);
}
public IngressSpecBuilder(IngressSpecFluent> fluent){
this(fluent, true);
}
public IngressSpecBuilder(IngressSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new IngressSpec(), validationEnabled);
}
public IngressSpecBuilder(IngressSpecFluent> fluent,IngressSpec instance){
this(fluent, instance, true);
}
public IngressSpecBuilder(IngressSpecFluent> fluent,IngressSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withBackend(instance.getBackend());
fluent.withRules(instance.getRules());
fluent.withTls(instance.getTls());
this.validationEnabled = validationEnabled;
}
public IngressSpecBuilder(IngressSpec instance){
this(instance,true);
}
public IngressSpecBuilder(IngressSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withBackend(instance.getBackend());
this.withRules(instance.getRules());
this.withTls(instance.getTls());
this.validationEnabled = validationEnabled;
}
public IngressSpec build(){
IngressSpec buildable = new IngressSpec(fluent.getBackend(),fluent.getRules(),fluent.getTls());
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;
IngressSpecBuilder that = (IngressSpecBuilder) 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;
}
}