io.alauda.kubernetes.api.model.EnvVarSourceFluentImpl 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 io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import javax.validation.Valid;
import java.lang.Object;
public class EnvVarSourceFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements EnvVarSourceFluent{
private ConfigMapKeySelectorBuilder configMapKeyRef;
private ObjectFieldSelectorBuilder fieldRef;
private ResourceFieldSelectorBuilder resourceFieldRef;
private SecretKeySelectorBuilder secretKeyRef;
public EnvVarSourceFluentImpl(){
}
public EnvVarSourceFluentImpl(EnvVarSource instance){
this.withConfigMapKeyRef(instance.getConfigMapKeyRef());
this.withFieldRef(instance.getFieldRef());
this.withResourceFieldRef(instance.getResourceFieldRef());
this.withSecretKeyRef(instance.getSecretKeyRef());
}
/**
* This method has been deprecated, please use method buildConfigMapKeyRef instead.
*/
@Deprecated public ConfigMapKeySelector getConfigMapKeyRef(){
return this.configMapKeyRef!=null?this.configMapKeyRef.build():null;
}
public ConfigMapKeySelector buildConfigMapKeyRef(){
return this.configMapKeyRef!=null?this.configMapKeyRef.build():null;
}
public A withConfigMapKeyRef(ConfigMapKeySelector configMapKeyRef){
_visitables.remove(this.configMapKeyRef);
if (configMapKeyRef!=null){ this.configMapKeyRef= new ConfigMapKeySelectorBuilder(configMapKeyRef); _visitables.add(this.configMapKeyRef);} return (A) this;
}
public Boolean hasConfigMapKeyRef(){
return this.configMapKeyRef!=null;
}
public EnvVarSourceFluent.ConfigMapKeyRefNested withNewConfigMapKeyRef(){
return new ConfigMapKeyRefNestedImpl();
}
public EnvVarSourceFluent.ConfigMapKeyRefNested withNewConfigMapKeyRefLike(ConfigMapKeySelector item){
return new ConfigMapKeyRefNestedImpl(item);
}
public EnvVarSourceFluent.ConfigMapKeyRefNested editConfigMapKeyRef(){
return withNewConfigMapKeyRefLike(getConfigMapKeyRef());
}
public EnvVarSourceFluent.ConfigMapKeyRefNested editOrNewConfigMapKeyRef(){
return withNewConfigMapKeyRefLike(getConfigMapKeyRef() != null ? getConfigMapKeyRef(): new ConfigMapKeySelectorBuilder().build());
}
public EnvVarSourceFluent.ConfigMapKeyRefNested editOrNewConfigMapKeyRefLike(ConfigMapKeySelector item){
return withNewConfigMapKeyRefLike(getConfigMapKeyRef() != null ? getConfigMapKeyRef(): item);
}
public A withNewConfigMapKeyRef(String key,String name,Boolean optional){
return (A)withConfigMapKeyRef(new ConfigMapKeySelector(key, name, optional));
}
/**
* This method has been deprecated, please use method buildFieldRef instead.
*/
@Deprecated public ObjectFieldSelector getFieldRef(){
return this.fieldRef!=null?this.fieldRef.build():null;
}
public ObjectFieldSelector buildFieldRef(){
return this.fieldRef!=null?this.fieldRef.build():null;
}
public A withFieldRef(ObjectFieldSelector fieldRef){
_visitables.remove(this.fieldRef);
if (fieldRef!=null){ this.fieldRef= new ObjectFieldSelectorBuilder(fieldRef); _visitables.add(this.fieldRef);} return (A) this;
}
public Boolean hasFieldRef(){
return this.fieldRef!=null;
}
public EnvVarSourceFluent.FieldRefNested withNewFieldRef(){
return new FieldRefNestedImpl();
}
public EnvVarSourceFluent.FieldRefNested withNewFieldRefLike(ObjectFieldSelector item){
return new FieldRefNestedImpl(item);
}
public EnvVarSourceFluent.FieldRefNested editFieldRef(){
return withNewFieldRefLike(getFieldRef());
}
public EnvVarSourceFluent.FieldRefNested editOrNewFieldRef(){
return withNewFieldRefLike(getFieldRef() != null ? getFieldRef(): new ObjectFieldSelectorBuilder().build());
}
public EnvVarSourceFluent.FieldRefNested editOrNewFieldRefLike(ObjectFieldSelector item){
return withNewFieldRefLike(getFieldRef() != null ? getFieldRef(): item);
}
public A withNewFieldRef(String apiVersion,String fieldPath){
return (A)withFieldRef(new ObjectFieldSelector(apiVersion, fieldPath));
}
/**
* This method has been deprecated, please use method buildResourceFieldRef instead.
*/
@Deprecated public ResourceFieldSelector getResourceFieldRef(){
return this.resourceFieldRef!=null?this.resourceFieldRef.build():null;
}
public ResourceFieldSelector buildResourceFieldRef(){
return this.resourceFieldRef!=null?this.resourceFieldRef.build():null;
}
public A withResourceFieldRef(ResourceFieldSelector resourceFieldRef){
_visitables.remove(this.resourceFieldRef);
if (resourceFieldRef!=null){ this.resourceFieldRef= new ResourceFieldSelectorBuilder(resourceFieldRef); _visitables.add(this.resourceFieldRef);} return (A) this;
}
public Boolean hasResourceFieldRef(){
return this.resourceFieldRef!=null;
}
public EnvVarSourceFluent.ResourceFieldRefNested withNewResourceFieldRef(){
return new ResourceFieldRefNestedImpl();
}
public EnvVarSourceFluent.ResourceFieldRefNested withNewResourceFieldRefLike(ResourceFieldSelector item){
return new ResourceFieldRefNestedImpl(item);
}
public EnvVarSourceFluent.ResourceFieldRefNested editResourceFieldRef(){
return withNewResourceFieldRefLike(getResourceFieldRef());
}
public EnvVarSourceFluent.ResourceFieldRefNested editOrNewResourceFieldRef(){
return withNewResourceFieldRefLike(getResourceFieldRef() != null ? getResourceFieldRef(): new ResourceFieldSelectorBuilder().build());
}
public EnvVarSourceFluent.ResourceFieldRefNested editOrNewResourceFieldRefLike(ResourceFieldSelector item){
return withNewResourceFieldRefLike(getResourceFieldRef() != null ? getResourceFieldRef(): item);
}
/**
* This method has been deprecated, please use method buildSecretKeyRef instead.
*/
@Deprecated public SecretKeySelector getSecretKeyRef(){
return this.secretKeyRef!=null?this.secretKeyRef.build():null;
}
public SecretKeySelector buildSecretKeyRef(){
return this.secretKeyRef!=null?this.secretKeyRef.build():null;
}
public A withSecretKeyRef(SecretKeySelector secretKeyRef){
_visitables.remove(this.secretKeyRef);
if (secretKeyRef!=null){ this.secretKeyRef= new SecretKeySelectorBuilder(secretKeyRef); _visitables.add(this.secretKeyRef);} return (A) this;
}
public Boolean hasSecretKeyRef(){
return this.secretKeyRef!=null;
}
public EnvVarSourceFluent.SecretKeyRefNested withNewSecretKeyRef(){
return new SecretKeyRefNestedImpl();
}
public EnvVarSourceFluent.SecretKeyRefNested withNewSecretKeyRefLike(SecretKeySelector item){
return new SecretKeyRefNestedImpl(item);
}
public EnvVarSourceFluent.SecretKeyRefNested editSecretKeyRef(){
return withNewSecretKeyRefLike(getSecretKeyRef());
}
public EnvVarSourceFluent.SecretKeyRefNested editOrNewSecretKeyRef(){
return withNewSecretKeyRefLike(getSecretKeyRef() != null ? getSecretKeyRef(): new SecretKeySelectorBuilder().build());
}
public EnvVarSourceFluent.SecretKeyRefNested editOrNewSecretKeyRefLike(SecretKeySelector item){
return withNewSecretKeyRefLike(getSecretKeyRef() != null ? getSecretKeyRef(): item);
}
public A withNewSecretKeyRef(String key,String name,Boolean optional){
return (A)withSecretKeyRef(new SecretKeySelector(key, 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;
EnvVarSourceFluentImpl that = (EnvVarSourceFluentImpl) o;
if (configMapKeyRef != null ? !configMapKeyRef.equals(that.configMapKeyRef) :that.configMapKeyRef != null) return false;
if (fieldRef != null ? !fieldRef.equals(that.fieldRef) :that.fieldRef != null) return false;
if (resourceFieldRef != null ? !resourceFieldRef.equals(that.resourceFieldRef) :that.resourceFieldRef != null) return false;
if (secretKeyRef != null ? !secretKeyRef.equals(that.secretKeyRef) :that.secretKeyRef != null) return false;
return true;
}
public class ConfigMapKeyRefNestedImpl extends ConfigMapKeySelectorFluentImpl> implements EnvVarSourceFluent.ConfigMapKeyRefNested,io.alauda.kubernetes.api.builder.Nested{
private final ConfigMapKeySelectorBuilder builder;
ConfigMapKeyRefNestedImpl(ConfigMapKeySelector item){
this.builder = new ConfigMapKeySelectorBuilder(this, item);
}
ConfigMapKeyRefNestedImpl(){
this.builder = new ConfigMapKeySelectorBuilder(this);
}
public N and(){
return (N) EnvVarSourceFluentImpl.this.withConfigMapKeyRef(builder.build());
}
public N endConfigMapKeyRef(){
return and();
}
}
public class FieldRefNestedImpl extends ObjectFieldSelectorFluentImpl> implements EnvVarSourceFluent.FieldRefNested,io.alauda.kubernetes.api.builder.Nested{
private final ObjectFieldSelectorBuilder builder;
FieldRefNestedImpl(ObjectFieldSelector item){
this.builder = new ObjectFieldSelectorBuilder(this, item);
}
FieldRefNestedImpl(){
this.builder = new ObjectFieldSelectorBuilder(this);
}
public N and(){
return (N) EnvVarSourceFluentImpl.this.withFieldRef(builder.build());
}
public N endFieldRef(){
return and();
}
}
public class ResourceFieldRefNestedImpl extends ResourceFieldSelectorFluentImpl> implements EnvVarSourceFluent.ResourceFieldRefNested,io.alauda.kubernetes.api.builder.Nested{
private final ResourceFieldSelectorBuilder builder;
ResourceFieldRefNestedImpl(ResourceFieldSelector item){
this.builder = new ResourceFieldSelectorBuilder(this, item);
}
ResourceFieldRefNestedImpl(){
this.builder = new ResourceFieldSelectorBuilder(this);
}
public N and(){
return (N) EnvVarSourceFluentImpl.this.withResourceFieldRef(builder.build());
}
public N endResourceFieldRef(){
return and();
}
}
public class SecretKeyRefNestedImpl extends SecretKeySelectorFluentImpl> implements EnvVarSourceFluent.SecretKeyRefNested,io.alauda.kubernetes.api.builder.Nested{
private final SecretKeySelectorBuilder builder;
SecretKeyRefNestedImpl(SecretKeySelector item){
this.builder = new SecretKeySelectorBuilder(this, item);
}
SecretKeyRefNestedImpl(){
this.builder = new SecretKeySelectorBuilder(this);
}
public N and(){
return (N) EnvVarSourceFluentImpl.this.withSecretKeyRef(builder.build());
}
public N endSecretKeyRef(){
return and();
}
}
}