annotations.io.alauda.kubernetes.api.model.extensions.IngressRuleFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model.extensions;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class IngressRuleFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements IngressRuleFluent{
private String host;
private HTTPIngressRuleValueBuilder http;
public IngressRuleFluentImpl(){
}
public IngressRuleFluentImpl(IngressRule instance){
this.withHost(instance.getHost());
this.withHttp(instance.getHttp());
}
public String getHost(){
return this.host;
}
public A withHost(String host){
this.host=host; return (A) this;
}
public Boolean hasHost(){
return this.host!=null;
}
/**
* This method has been deprecated, please use method buildHttp instead.
*/
@Deprecated public HTTPIngressRuleValue getHttp(){
return this.http!=null?this.http.build():null;
}
public HTTPIngressRuleValue buildHttp(){
return this.http!=null?this.http.build():null;
}
public A withHttp(HTTPIngressRuleValue http){
_visitables.remove(this.http);
if (http!=null){ this.http= new HTTPIngressRuleValueBuilder(http); _visitables.add(this.http);} return (A) this;
}
public Boolean hasHttp(){
return this.http!=null;
}
public IngressRuleFluent.HttpNested withNewHttp(){
return new HttpNestedImpl();
}
public IngressRuleFluent.HttpNested withNewHttpLike(HTTPIngressRuleValue item){
return new HttpNestedImpl(item);
}
public IngressRuleFluent.HttpNested editHttp(){
return withNewHttpLike(getHttp());
}
public IngressRuleFluent.HttpNested editOrNewHttp(){
return withNewHttpLike(getHttp() != null ? getHttp(): new HTTPIngressRuleValueBuilder().build());
}
public IngressRuleFluent.HttpNested editOrNewHttpLike(HTTPIngressRuleValue item){
return withNewHttpLike(getHttp() != null ? getHttp(): item);
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
IngressRuleFluentImpl that = (IngressRuleFluentImpl) o;
if (host != null ? !host.equals(that.host) :that.host != null) return false;
if (http != null ? !http.equals(that.http) :that.http != null) return false;
return true;
}
public class HttpNestedImpl extends HTTPIngressRuleValueFluentImpl> implements IngressRuleFluent.HttpNested,io.alauda.kubernetes.api.builder.Nested{
private final HTTPIngressRuleValueBuilder builder;
HttpNestedImpl(HTTPIngressRuleValue item){
this.builder = new HTTPIngressRuleValueBuilder(this, item);
}
HttpNestedImpl(){
this.builder = new HTTPIngressRuleValueBuilder(this);
}
public N and(){
return (N) IngressRuleFluentImpl.this.withHttp(builder.build());
}
public N endHttp(){
return and();
}
}
}