All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kubernetes.client.openapi.models.V1EnvFromSourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class V1EnvFromSourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1EnvFromSourceFluent {

    private V1ConfigMapEnvSourceBuilder configMapRef;
    private String prefix;
    private V1SecretEnvSourceBuilder secretRef;

    public V1EnvFromSourceFluentImpl() { 
    }


    public V1EnvFromSourceFluentImpl(V1EnvFromSource instance) { 
        this.withConfigMapRef(instance.getConfigMapRef());

        this.withPrefix(instance.getPrefix());

        this.withSecretRef(instance.getSecretRef());

    }


    
/**
 * This method has been deprecated, please use method buildConfigMapRef instead.
 * @return The buildable object.
 */
@Deprecated public V1ConfigMapEnvSource getConfigMapRef() {
        return this.configMapRef!=null?this.configMapRef.build():null;
    }

    public V1ConfigMapEnvSource buildConfigMapRef() {
        return this.configMapRef!=null?this.configMapRef.build():null;
    }

    public A withConfigMapRef(V1ConfigMapEnvSource configMapRef) {
        _visitables.get("configMapRef").remove(this.configMapRef);
        if (configMapRef!=null){ this.configMapRef= new V1ConfigMapEnvSourceBuilder(configMapRef); _visitables.get("configMapRef").add(this.configMapRef);} return (A) this;
    }

    public Boolean hasConfigMapRef() {
        return this.configMapRef != null;
    }

    public V1EnvFromSourceFluent.ConfigMapRefNested withNewConfigMapRef() {
        return new ConfigMapRefNestedImpl();
    }

    public V1EnvFromSourceFluent.ConfigMapRefNested withNewConfigMapRefLike(V1ConfigMapEnvSource item) {
        return new ConfigMapRefNestedImpl(item);
    }

    public V1EnvFromSourceFluent.ConfigMapRefNested editConfigMapRef() {
        return withNewConfigMapRefLike(getConfigMapRef());
    }

    public V1EnvFromSourceFluent.ConfigMapRefNested editOrNewConfigMapRef() {
        return withNewConfigMapRefLike(getConfigMapRef() != null ? getConfigMapRef(): new V1ConfigMapEnvSourceBuilder().build());
    }

    public V1EnvFromSourceFluent.ConfigMapRefNested editOrNewConfigMapRefLike(V1ConfigMapEnvSource item) {
        return withNewConfigMapRefLike(getConfigMapRef() != null ? getConfigMapRef(): item);
    }

    public String getPrefix() {
        return this.prefix;
    }

    public A withPrefix(String prefix) {
        this.prefix=prefix; return (A) this;
    }

    public Boolean hasPrefix() {
        return this.prefix != null;
    }

    public A withNewPrefix(String arg1) {
        return (A)withPrefix(new String(arg1));
    }

    public A withNewPrefix(StringBuilder arg1) {
        return (A)withPrefix(new String(arg1));
    }

    public A withNewPrefix(StringBuffer arg1) {
        return (A)withPrefix(new String(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildSecretRef instead.
 * @return The buildable object.
 */
@Deprecated public V1SecretEnvSource getSecretRef() {
        return this.secretRef!=null?this.secretRef.build():null;
    }

    public V1SecretEnvSource buildSecretRef() {
        return this.secretRef!=null?this.secretRef.build():null;
    }

    public A withSecretRef(V1SecretEnvSource secretRef) {
        _visitables.get("secretRef").remove(this.secretRef);
        if (secretRef!=null){ this.secretRef= new V1SecretEnvSourceBuilder(secretRef); _visitables.get("secretRef").add(this.secretRef);} return (A) this;
    }

    public Boolean hasSecretRef() {
        return this.secretRef != null;
    }

    public V1EnvFromSourceFluent.SecretRefNested withNewSecretRef() {
        return new SecretRefNestedImpl();
    }

    public V1EnvFromSourceFluent.SecretRefNested withNewSecretRefLike(V1SecretEnvSource item) {
        return new SecretRefNestedImpl(item);
    }

    public V1EnvFromSourceFluent.SecretRefNested editSecretRef() {
        return withNewSecretRefLike(getSecretRef());
    }

    public V1EnvFromSourceFluent.SecretRefNested editOrNewSecretRef() {
        return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): new V1SecretEnvSourceBuilder().build());
    }

    public V1EnvFromSourceFluent.SecretRefNested editOrNewSecretRefLike(V1SecretEnvSource item) {
        return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): item);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1EnvFromSourceFluentImpl that = (V1EnvFromSourceFluentImpl) o;
        if (configMapRef != null ? !configMapRef.equals(that.configMapRef) :that.configMapRef != null) return false;
        if (prefix != null ? !prefix.equals(that.prefix) :that.prefix != null) return false;
        if (secretRef != null ? !secretRef.equals(that.secretRef) :that.secretRef != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(configMapRef,  prefix,  secretRef,  super.hashCode());
    }

    public class ConfigMapRefNestedImpl extends V1ConfigMapEnvSourceFluentImpl> implements V1EnvFromSourceFluent.ConfigMapRefNested,io.kubernetes.client.fluent.Nested {
        private final V1ConfigMapEnvSourceBuilder builder;

        ConfigMapRefNestedImpl(V1ConfigMapEnvSource item) {
            this.builder = new V1ConfigMapEnvSourceBuilder(this, item);
        }

        ConfigMapRefNestedImpl() {
            this.builder = new V1ConfigMapEnvSourceBuilder(this);
        }

        public N and() {
             return (N) V1EnvFromSourceFluentImpl.this.withConfigMapRef(builder.build());
        }

        public N endConfigMapRef() {
             return and();
        }
    }


    public class SecretRefNestedImpl extends V1SecretEnvSourceFluentImpl> implements V1EnvFromSourceFluent.SecretRefNested,io.kubernetes.client.fluent.Nested {
        private final V1SecretEnvSourceBuilder builder;

        SecretRefNestedImpl(V1SecretEnvSource item) {
            this.builder = new V1SecretEnvSourceBuilder(this, item);
        }

        SecretRefNestedImpl() {
            this.builder = new V1SecretEnvSourceBuilder(this);
        }

        public N and() {
             return (N) V1EnvFromSourceFluentImpl.this.withSecretRef(builder.build());
        }

        public N endSecretRef() {
             return and();
        }
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy