io.alauda.kubernetes.api.model.extensions.IngressBackendBuilder 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 IngressBackendBuilder extends IngressBackendFluentImpl implements VisitableBuilder{
IngressBackendFluent> fluent;
Boolean validationEnabled;
public IngressBackendBuilder(){
this(true);
}
public IngressBackendBuilder(Boolean validationEnabled){
this(new IngressBackend(), validationEnabled);
}
public IngressBackendBuilder(IngressBackendFluent> fluent){
this(fluent, true);
}
public IngressBackendBuilder(IngressBackendFluent> fluent,Boolean validationEnabled){
this(fluent, new IngressBackend(), validationEnabled);
}
public IngressBackendBuilder(IngressBackendFluent> fluent,IngressBackend instance){
this(fluent, instance, true);
}
public IngressBackendBuilder(IngressBackendFluent> fluent,IngressBackend instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withServiceName(instance.getServiceName());
fluent.withServicePort(instance.getServicePort());
this.validationEnabled = validationEnabled;
}
public IngressBackendBuilder(IngressBackend instance){
this(instance,true);
}
public IngressBackendBuilder(IngressBackend instance,Boolean validationEnabled){
this.fluent = this;
this.withServiceName(instance.getServiceName());
this.withServicePort(instance.getServicePort());
this.validationEnabled = validationEnabled;
}
public IngressBackend build(){
IngressBackend buildable = new IngressBackend(fluent.getServiceName(),fluent.getServicePort());
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;
IngressBackendBuilder that = (IngressBackendBuilder) 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;
}
}