
io.fabric8.openclustermanagement.api.model.app.k8s.v1beta1.InfoItemSourceFluent Maven / Gradle / Ivy
package io.fabric8.openclustermanagement.api.model.app.k8s.v1beta1;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class InfoItemSourceFluent> extends BaseFluent{
public InfoItemSourceFluent() {
}
public InfoItemSourceFluent(InfoItemSource instance) {
this.copyInstance(instance);
}
private ConfigMapKeySelectorBuilder configMapKeyRef;
private IngressSelectorBuilder ingressRef;
private SecretKeySelectorBuilder secretKeyRef;
private ServiceSelectorBuilder serviceRef;
private String type;
private Map additionalProperties;
protected void copyInstance(InfoItemSource instance) {
instance = (instance != null ? instance : new InfoItemSource());
if (instance != null) {
this.withConfigMapKeyRef(instance.getConfigMapKeyRef());
this.withIngressRef(instance.getIngressRef());
this.withSecretKeyRef(instance.getSecretKeyRef());
this.withServiceRef(instance.getServiceRef());
this.withType(instance.getType());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public ConfigMapKeySelector buildConfigMapKeyRef() {
return this.configMapKeyRef != null ? this.configMapKeyRef.build() : null;
}
public A withConfigMapKeyRef(ConfigMapKeySelector configMapKeyRef) {
this._visitables.remove("configMapKeyRef");
if (configMapKeyRef != null) {
this.configMapKeyRef = new ConfigMapKeySelectorBuilder(configMapKeyRef);
this._visitables.get("configMapKeyRef").add(this.configMapKeyRef);
} else {
this.configMapKeyRef = null;
this._visitables.get("configMapKeyRef").remove(this.configMapKeyRef);
}
return (A) this;
}
public boolean hasConfigMapKeyRef() {
return this.configMapKeyRef != null;
}
public ConfigMapKeyRefNested withNewConfigMapKeyRef() {
return new ConfigMapKeyRefNested(null);
}
public ConfigMapKeyRefNested withNewConfigMapKeyRefLike(ConfigMapKeySelector item) {
return new ConfigMapKeyRefNested(item);
}
public ConfigMapKeyRefNested editConfigMapKeyRef() {
return withNewConfigMapKeyRefLike(java.util.Optional.ofNullable(buildConfigMapKeyRef()).orElse(null));
}
public ConfigMapKeyRefNested editOrNewConfigMapKeyRef() {
return withNewConfigMapKeyRefLike(java.util.Optional.ofNullable(buildConfigMapKeyRef()).orElse(new ConfigMapKeySelectorBuilder().build()));
}
public ConfigMapKeyRefNested editOrNewConfigMapKeyRefLike(ConfigMapKeySelector item) {
return withNewConfigMapKeyRefLike(java.util.Optional.ofNullable(buildConfigMapKeyRef()).orElse(item));
}
public IngressSelector buildIngressRef() {
return this.ingressRef != null ? this.ingressRef.build() : null;
}
public A withIngressRef(IngressSelector ingressRef) {
this._visitables.remove("ingressRef");
if (ingressRef != null) {
this.ingressRef = new IngressSelectorBuilder(ingressRef);
this._visitables.get("ingressRef").add(this.ingressRef);
} else {
this.ingressRef = null;
this._visitables.get("ingressRef").remove(this.ingressRef);
}
return (A) this;
}
public boolean hasIngressRef() {
return this.ingressRef != null;
}
public IngressRefNested withNewIngressRef() {
return new IngressRefNested(null);
}
public IngressRefNested withNewIngressRefLike(IngressSelector item) {
return new IngressRefNested(item);
}
public IngressRefNested editIngressRef() {
return withNewIngressRefLike(java.util.Optional.ofNullable(buildIngressRef()).orElse(null));
}
public IngressRefNested editOrNewIngressRef() {
return withNewIngressRefLike(java.util.Optional.ofNullable(buildIngressRef()).orElse(new IngressSelectorBuilder().build()));
}
public IngressRefNested editOrNewIngressRefLike(IngressSelector item) {
return withNewIngressRefLike(java.util.Optional.ofNullable(buildIngressRef()).orElse(item));
}
public SecretKeySelector buildSecretKeyRef() {
return this.secretKeyRef != null ? this.secretKeyRef.build() : null;
}
public A withSecretKeyRef(SecretKeySelector secretKeyRef) {
this._visitables.remove("secretKeyRef");
if (secretKeyRef != null) {
this.secretKeyRef = new SecretKeySelectorBuilder(secretKeyRef);
this._visitables.get("secretKeyRef").add(this.secretKeyRef);
} else {
this.secretKeyRef = null;
this._visitables.get("secretKeyRef").remove(this.secretKeyRef);
}
return (A) this;
}
public boolean hasSecretKeyRef() {
return this.secretKeyRef != null;
}
public SecretKeyRefNested withNewSecretKeyRef() {
return new SecretKeyRefNested(null);
}
public SecretKeyRefNested withNewSecretKeyRefLike(SecretKeySelector item) {
return new SecretKeyRefNested(item);
}
public SecretKeyRefNested editSecretKeyRef() {
return withNewSecretKeyRefLike(java.util.Optional.ofNullable(buildSecretKeyRef()).orElse(null));
}
public SecretKeyRefNested editOrNewSecretKeyRef() {
return withNewSecretKeyRefLike(java.util.Optional.ofNullable(buildSecretKeyRef()).orElse(new SecretKeySelectorBuilder().build()));
}
public SecretKeyRefNested editOrNewSecretKeyRefLike(SecretKeySelector item) {
return withNewSecretKeyRefLike(java.util.Optional.ofNullable(buildSecretKeyRef()).orElse(item));
}
public ServiceSelector buildServiceRef() {
return this.serviceRef != null ? this.serviceRef.build() : null;
}
public A withServiceRef(ServiceSelector serviceRef) {
this._visitables.remove("serviceRef");
if (serviceRef != null) {
this.serviceRef = new ServiceSelectorBuilder(serviceRef);
this._visitables.get("serviceRef").add(this.serviceRef);
} else {
this.serviceRef = null;
this._visitables.get("serviceRef").remove(this.serviceRef);
}
return (A) this;
}
public boolean hasServiceRef() {
return this.serviceRef != null;
}
public ServiceRefNested withNewServiceRef() {
return new ServiceRefNested(null);
}
public ServiceRefNested withNewServiceRefLike(ServiceSelector item) {
return new ServiceRefNested(item);
}
public ServiceRefNested editServiceRef() {
return withNewServiceRefLike(java.util.Optional.ofNullable(buildServiceRef()).orElse(null));
}
public ServiceRefNested editOrNewServiceRef() {
return withNewServiceRefLike(java.util.Optional.ofNullable(buildServiceRef()).orElse(new ServiceSelectorBuilder().build()));
}
public ServiceRefNested editOrNewServiceRefLike(ServiceSelector item) {
return withNewServiceRefLike(java.util.Optional.ofNullable(buildServiceRef()).orElse(item));
}
public String getType() {
return this.type;
}
public A withType(String type) {
this.type = type;
return (A) this;
}
public boolean hasType() {
return this.type != null;
}
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;
InfoItemSourceFluent that = (InfoItemSourceFluent) o;
if (!java.util.Objects.equals(configMapKeyRef, that.configMapKeyRef)) return false;
if (!java.util.Objects.equals(ingressRef, that.ingressRef)) return false;
if (!java.util.Objects.equals(secretKeyRef, that.secretKeyRef)) return false;
if (!java.util.Objects.equals(serviceRef, that.serviceRef)) return false;
if (!java.util.Objects.equals(type, that.type)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(configMapKeyRef, ingressRef, secretKeyRef, serviceRef, type, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (configMapKeyRef != null) { sb.append("configMapKeyRef:"); sb.append(configMapKeyRef + ","); }
if (ingressRef != null) { sb.append("ingressRef:"); sb.append(ingressRef + ","); }
if (secretKeyRef != null) { sb.append("secretKeyRef:"); sb.append(secretKeyRef + ","); }
if (serviceRef != null) { sb.append("serviceRef:"); sb.append(serviceRef + ","); }
if (type != null) { sb.append("type:"); sb.append(type + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class ConfigMapKeyRefNested extends ConfigMapKeySelectorFluent> implements Nested{
ConfigMapKeyRefNested(ConfigMapKeySelector item) {
this.builder = new ConfigMapKeySelectorBuilder(this, item);
}
ConfigMapKeySelectorBuilder builder;
public N and() {
return (N) InfoItemSourceFluent.this.withConfigMapKeyRef(builder.build());
}
public N endConfigMapKeyRef() {
return and();
}
}
public class IngressRefNested extends IngressSelectorFluent> implements Nested{
IngressRefNested(IngressSelector item) {
this.builder = new IngressSelectorBuilder(this, item);
}
IngressSelectorBuilder builder;
public N and() {
return (N) InfoItemSourceFluent.this.withIngressRef(builder.build());
}
public N endIngressRef() {
return and();
}
}
public class SecretKeyRefNested extends SecretKeySelectorFluent> implements Nested{
SecretKeyRefNested(SecretKeySelector item) {
this.builder = new SecretKeySelectorBuilder(this, item);
}
SecretKeySelectorBuilder builder;
public N and() {
return (N) InfoItemSourceFluent.this.withSecretKeyRef(builder.build());
}
public N endSecretKeyRef() {
return and();
}
}
public class ServiceRefNested extends ServiceSelectorFluent> implements Nested{
ServiceRefNested(ServiceSelector item) {
this.builder = new ServiceSelectorBuilder(this, item);
}
ServiceSelectorBuilder builder;
public N and() {
return (N) InfoItemSourceFluent.this.withServiceRef(builder.build());
}
public N endServiceRef() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy