io.alauda.kubernetes.api.model.EnvFromSourceFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
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 EnvFromSourceFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements EnvFromSourceFluent{
private ConfigMapEnvSourceBuilder configMapRef;
private String prefix;
private SecretEnvSourceBuilder secretRef;
public EnvFromSourceFluentImpl(){
}
public EnvFromSourceFluentImpl(EnvFromSource instance){
this.withConfigMapRef(instance.getConfigMapRef());
this.withPrefix(instance.getPrefix());
this.withSecretRef(instance.getSecretRef());
}
/**
* This method has been deprecated, please use method buildConfigMapRef instead.
*/
@Deprecated public ConfigMapEnvSource getConfigMapRef(){
return this.configMapRef!=null?this.configMapRef.build():null;
}
public ConfigMapEnvSource buildConfigMapRef(){
return this.configMapRef!=null?this.configMapRef.build():null;
}
public A withConfigMapRef(ConfigMapEnvSource configMapRef){
_visitables.remove(this.configMapRef);
if (configMapRef!=null){ this.configMapRef= new ConfigMapEnvSourceBuilder(configMapRef); _visitables.add(this.configMapRef);} return (A) this;
}
public Boolean hasConfigMapRef(){
return this.configMapRef!=null;
}
public EnvFromSourceFluent.ConfigMapRefNested withNewConfigMapRef(){
return new ConfigMapRefNestedImpl();
}
public EnvFromSourceFluent.ConfigMapRefNested withNewConfigMapRefLike(ConfigMapEnvSource item){
return new ConfigMapRefNestedImpl(item);
}
public EnvFromSourceFluent.ConfigMapRefNested editConfigMapRef(){
return withNewConfigMapRefLike(getConfigMapRef());
}
public EnvFromSourceFluent.ConfigMapRefNested editOrNewConfigMapRef(){
return withNewConfigMapRefLike(getConfigMapRef() != null ? getConfigMapRef(): new ConfigMapEnvSourceBuilder().build());
}
public EnvFromSourceFluent.ConfigMapRefNested editOrNewConfigMapRefLike(ConfigMapEnvSource item){
return withNewConfigMapRefLike(getConfigMapRef() != null ? getConfigMapRef(): item);
}
public A withNewConfigMapRef(String name,Boolean optional){
return (A)withConfigMapRef(new ConfigMapEnvSource(name, optional));
}
public String getPrefix(){
return this.prefix;
}
public A withPrefix(String prefix){
this.prefix=prefix; return (A) this;
}
public Boolean hasPrefix(){
return this.prefix!=null;
}
/**
* This method has been deprecated, please use method buildSecretRef instead.
*/
@Deprecated public SecretEnvSource getSecretRef(){
return this.secretRef!=null?this.secretRef.build():null;
}
public SecretEnvSource buildSecretRef(){
return this.secretRef!=null?this.secretRef.build():null;
}
public A withSecretRef(SecretEnvSource secretRef){
_visitables.remove(this.secretRef);
if (secretRef!=null){ this.secretRef= new SecretEnvSourceBuilder(secretRef); _visitables.add(this.secretRef);} return (A) this;
}
public Boolean hasSecretRef(){
return this.secretRef!=null;
}
public EnvFromSourceFluent.SecretRefNested withNewSecretRef(){
return new SecretRefNestedImpl();
}
public EnvFromSourceFluent.SecretRefNested withNewSecretRefLike(SecretEnvSource item){
return new SecretRefNestedImpl(item);
}
public EnvFromSourceFluent.SecretRefNested editSecretRef(){
return withNewSecretRefLike(getSecretRef());
}
public EnvFromSourceFluent.SecretRefNested editOrNewSecretRef(){
return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): new SecretEnvSourceBuilder().build());
}
public EnvFromSourceFluent.SecretRefNested editOrNewSecretRefLike(SecretEnvSource item){
return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): item);
}
public A withNewSecretRef(String name,Boolean optional){
return (A)withSecretRef(new SecretEnvSource(name, optional));
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
EnvFromSourceFluentImpl that = (EnvFromSourceFluentImpl) 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 class ConfigMapRefNestedImpl extends ConfigMapEnvSourceFluentImpl> implements EnvFromSourceFluent.ConfigMapRefNested,io.alauda.kubernetes.api.builder.Nested{
private final ConfigMapEnvSourceBuilder builder;
ConfigMapRefNestedImpl(ConfigMapEnvSource item){
this.builder = new ConfigMapEnvSourceBuilder(this, item);
}
ConfigMapRefNestedImpl(){
this.builder = new ConfigMapEnvSourceBuilder(this);
}
public N and(){
return (N) EnvFromSourceFluentImpl.this.withConfigMapRef(builder.build());
}
public N endConfigMapRef(){
return and();
}
}
public class SecretRefNestedImpl extends SecretEnvSourceFluentImpl> implements EnvFromSourceFluent.SecretRefNested,io.alauda.kubernetes.api.builder.Nested{
private final SecretEnvSourceBuilder builder;
SecretRefNestedImpl(SecretEnvSource item){
this.builder = new SecretEnvSourceBuilder(this, item);
}
SecretRefNestedImpl(){
this.builder = new SecretEnvSourceBuilder(this);
}
public N and(){
return (N) EnvFromSourceFluentImpl.this.withSecretRef(builder.build());
}
public N endSecretRef(){
return and();
}
}
}