io.fabric8.knative.internal.networking.v1alpha1.IngressBackendSplitFluent Maven / Gradle / Ivy
The newest version!
package io.fabric8.knative.internal.networking.v1alpha1;
import io.fabric8.kubernetes.api.model.IntOrString;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import io.fabric8.kubernetes.api.model.IntOrStringFluent;
import io.fabric8.kubernetes.api.model.IntOrStringBuilder;
import java.util.LinkedHashMap;
import java.lang.Integer;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class IngressBackendSplitFluent> extends BaseFluent{
public IngressBackendSplitFluent() {
}
public IngressBackendSplitFluent(IngressBackendSplit instance) {
this.copyInstance(instance);
}
private Map appendHeaders;
private Integer percent;
private String serviceName;
private String serviceNamespace;
private IntOrStringBuilder servicePort;
private Map additionalProperties;
protected void copyInstance(IngressBackendSplit instance) {
instance = (instance != null ? instance : new IngressBackendSplit());
if (instance != null) {
this.withAppendHeaders(instance.getAppendHeaders());
this.withPercent(instance.getPercent());
this.withServiceName(instance.getServiceName());
this.withServiceNamespace(instance.getServiceNamespace());
this.withServicePort(instance.getServicePort());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public A addToAppendHeaders(String key,String value) {
if(this.appendHeaders == null && key != null && value != null) { this.appendHeaders = new LinkedHashMap(); }
if(key != null && value != null) {this.appendHeaders.put(key, value);} return (A)this;
}
public A addToAppendHeaders(Map map) {
if(this.appendHeaders == null && map != null) { this.appendHeaders = new LinkedHashMap(); }
if(map != null) { this.appendHeaders.putAll(map);} return (A)this;
}
public A removeFromAppendHeaders(String key) {
if(this.appendHeaders == null) { return (A) this; }
if(key != null && this.appendHeaders != null) {this.appendHeaders.remove(key);} return (A)this;
}
public A removeFromAppendHeaders(Map map) {
if(this.appendHeaders == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.appendHeaders != null){this.appendHeaders.remove(key);}}} return (A)this;
}
public Map getAppendHeaders() {
return this.appendHeaders;
}
public A withAppendHeaders(Map appendHeaders) {
if (appendHeaders == null) {
this.appendHeaders = null;
} else {
this.appendHeaders = new LinkedHashMap(appendHeaders);
}
return (A) this;
}
public boolean hasAppendHeaders() {
return this.appendHeaders != null;
}
public Integer getPercent() {
return this.percent;
}
public A withPercent(Integer percent) {
this.percent = percent;
return (A) this;
}
public boolean hasPercent() {
return this.percent != null;
}
public String getServiceName() {
return this.serviceName;
}
public A withServiceName(String serviceName) {
this.serviceName = serviceName;
return (A) this;
}
public boolean hasServiceName() {
return this.serviceName != null;
}
public String getServiceNamespace() {
return this.serviceNamespace;
}
public A withServiceNamespace(String serviceNamespace) {
this.serviceNamespace = serviceNamespace;
return (A) this;
}
public boolean hasServiceNamespace() {
return this.serviceNamespace != null;
}
public IntOrString buildServicePort() {
return this.servicePort != null ? this.servicePort.build() : null;
}
public A withServicePort(IntOrString servicePort) {
this._visitables.remove("servicePort");
if (servicePort != null) {
this.servicePort = new IntOrStringBuilder(servicePort);
this._visitables.get("servicePort").add(this.servicePort);
} else {
this.servicePort = null;
this._visitables.get("servicePort").remove(this.servicePort);
}
return (A) this;
}
public boolean hasServicePort() {
return this.servicePort != null;
}
public A withNewServicePort(Object value) {
return (A)withServicePort(new IntOrString(value));
}
public ServicePortNested withNewServicePort() {
return new ServicePortNested(null);
}
public ServicePortNested withNewServicePortLike(IntOrString item) {
return new ServicePortNested(item);
}
public ServicePortNested editServicePort() {
return withNewServicePortLike(java.util.Optional.ofNullable(buildServicePort()).orElse(null));
}
public ServicePortNested editOrNewServicePort() {
return withNewServicePortLike(java.util.Optional.ofNullable(buildServicePort()).orElse(new IntOrStringBuilder().build()));
}
public ServicePortNested editOrNewServicePortLike(IntOrString item) {
return withNewServicePortLike(java.util.Optional.ofNullable(buildServicePort()).orElse(item));
}
public A addToAdditionalProperties(String key,Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(String key) {
if(this.additionalProperties == null) { return (A) this; }
if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
}
public A removeFromAdditionalProperties(Map map) {
if(this.additionalProperties == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
}
public Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(Map additionalProperties) {
if (additionalProperties == null) {
this.additionalProperties = null;
} else {
this.additionalProperties = new LinkedHashMap(additionalProperties);
}
return (A) this;
}
public boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
IngressBackendSplitFluent that = (IngressBackendSplitFluent) o;
if (!java.util.Objects.equals(appendHeaders, that.appendHeaders)) return false;
if (!java.util.Objects.equals(percent, that.percent)) return false;
if (!java.util.Objects.equals(serviceName, that.serviceName)) return false;
if (!java.util.Objects.equals(serviceNamespace, that.serviceNamespace)) return false;
if (!java.util.Objects.equals(servicePort, that.servicePort)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(appendHeaders, percent, serviceName, serviceNamespace, servicePort, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (appendHeaders != null && !appendHeaders.isEmpty()) { sb.append("appendHeaders:"); sb.append(appendHeaders + ","); }
if (percent != null) { sb.append("percent:"); sb.append(percent + ","); }
if (serviceName != null) { sb.append("serviceName:"); sb.append(serviceName + ","); }
if (serviceNamespace != null) { sb.append("serviceNamespace:"); sb.append(serviceNamespace + ","); }
if (servicePort != null) { sb.append("servicePort:"); sb.append(servicePort + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class ServicePortNested extends IntOrStringFluent> implements Nested{
ServicePortNested(IntOrString item) {
this.builder = new IntOrStringBuilder(this, item);
}
IntOrStringBuilder builder;
public N and() {
return (N) IngressBackendSplitFluent.this.withServicePort(builder.build());
}
public N endServicePort() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy