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

annotations.io.fabric8.knative.serving.v1.RevisionSpecFluentImpl Maven / Gradle / Ivy

package io.fabric8.knative.serving.v1;

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.StringBuilder;
import io.fabric8.kubernetes.api.model.TopologySpreadConstraint;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
import io.fabric8.kubernetes.api.model.EphemeralContainer;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.model.Container;
import io.fabric8.kubernetes.api.model.ContainerBuilder;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.model.PodDNSConfig;
import io.fabric8.kubernetes.api.model.VolumeFluentImpl;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import io.fabric8.kubernetes.api.model.PodSecurityContext;
import io.fabric8.kubernetes.api.model.Quantity;
import io.fabric8.kubernetes.api.model.ContainerFluentImpl;
import io.fabric8.kubernetes.api.model.PodReadinessGate;
import io.fabric8.kubernetes.api.model.HostAlias;
import java.lang.Integer;
import java.lang.StringBuffer;
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.LocalObjectReference;
import io.fabric8.kubernetes.api.model.Toleration;
import java.lang.Long;
import io.fabric8.kubernetes.api.model.Affinity;
import java.util.Collection;
import java.lang.Object;
import java.util.Map;

public class RevisionSpecFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements RevisionSpecFluent{

    private Long activeDeadlineSeconds;
    private Affinity affinity;
    private Boolean automountServiceAccountToken;
    private Long containerConcurrency;
    private List containers;
    private PodDNSConfig dnsConfig;
    private String dnsPolicy;
    private Boolean enableServiceLinks;
    private List ephemeralContainers;
    private List hostAliases;
    private Boolean hostIPC;
    private Boolean hostNetwork;
    private Boolean hostPID;
    private String hostname;
    private List imagePullSecrets;
    private List initContainers;
    private String nodeName;
    private Map nodeSelector;
    private Map overhead;
    private String preemptionPolicy;
    private Integer priority;
    private String priorityClassName;
    private List readinessGates;
    private String restartPolicy;
    private String runtimeClassName;
    private String schedulerName;
    private PodSecurityContext securityContext;
    private String serviceAccount;
    private String serviceAccountName;
    private Boolean shareProcessNamespace;
    private String subdomain;
    private Long terminationGracePeriodSeconds;
    private Long timeoutSeconds;
    private List tolerations;
    private List topologySpreadConstraints;
    private List volumes;

    public RevisionSpecFluentImpl(){
    }
    public RevisionSpecFluentImpl(RevisionSpec instance){
            this.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds()); 
            this.withAffinity(instance.getAffinity()); 
            this.withAutomountServiceAccountToken(instance.getAutomountServiceAccountToken()); 
            this.withContainerConcurrency(instance.getContainerConcurrency()); 
            this.withContainers(instance.getContainers()); 
            this.withDnsConfig(instance.getDnsConfig()); 
            this.withDnsPolicy(instance.getDnsPolicy()); 
            this.withEnableServiceLinks(instance.getEnableServiceLinks()); 
            this.withEphemeralContainers(instance.getEphemeralContainers()); 
            this.withHostAliases(instance.getHostAliases()); 
            this.withHostIPC(instance.getHostIPC()); 
            this.withHostNetwork(instance.getHostNetwork()); 
            this.withHostPID(instance.getHostPID()); 
            this.withHostname(instance.getHostname()); 
            this.withImagePullSecrets(instance.getImagePullSecrets()); 
            this.withInitContainers(instance.getInitContainers()); 
            this.withNodeName(instance.getNodeName()); 
            this.withNodeSelector(instance.getNodeSelector()); 
            this.withOverhead(instance.getOverhead()); 
            this.withPreemptionPolicy(instance.getPreemptionPolicy()); 
            this.withPriority(instance.getPriority()); 
            this.withPriorityClassName(instance.getPriorityClassName()); 
            this.withReadinessGates(instance.getReadinessGates()); 
            this.withRestartPolicy(instance.getRestartPolicy()); 
            this.withRuntimeClassName(instance.getRuntimeClassName()); 
            this.withSchedulerName(instance.getSchedulerName()); 
            this.withSecurityContext(instance.getSecurityContext()); 
            this.withServiceAccount(instance.getServiceAccount()); 
            this.withServiceAccountName(instance.getServiceAccountName()); 
            this.withShareProcessNamespace(instance.getShareProcessNamespace()); 
            this.withSubdomain(instance.getSubdomain()); 
            this.withTerminationGracePeriodSeconds(instance.getTerminationGracePeriodSeconds()); 
            this.withTimeoutSeconds(instance.getTimeoutSeconds()); 
            this.withTolerations(instance.getTolerations()); 
            this.withTopologySpreadConstraints(instance.getTopologySpreadConstraints()); 
            this.withVolumes(instance.getVolumes()); 
    }

    public Long getActiveDeadlineSeconds(){
            return this.activeDeadlineSeconds;
    }

    public A withActiveDeadlineSeconds(Long activeDeadlineSeconds){
            this.activeDeadlineSeconds=activeDeadlineSeconds; return (A) this;
    }

    public Boolean hasActiveDeadlineSeconds(){
            return this.activeDeadlineSeconds != null;
    }

    public Affinity getAffinity(){
            return this.affinity;
    }

    public A withAffinity(Affinity affinity){
            this.affinity=affinity; return (A) this;
    }

    public Boolean hasAffinity(){
            return this.affinity != null;
    }

    public Boolean isAutomountServiceAccountToken(){
            return this.automountServiceAccountToken;
    }

    public A withAutomountServiceAccountToken(Boolean automountServiceAccountToken){
            this.automountServiceAccountToken=automountServiceAccountToken; return (A) this;
    }

    public Boolean hasAutomountServiceAccountToken(){
            return this.automountServiceAccountToken != null;
    }

    public A withNewAutomountServiceAccountToken(String arg1){
            return (A)withAutomountServiceAccountToken(new Boolean(arg1));
    }

    public A withNewAutomountServiceAccountToken(boolean arg1){
            return (A)withAutomountServiceAccountToken(new Boolean(arg1));
    }

    public Long getContainerConcurrency(){
            return this.containerConcurrency;
    }

    public A withContainerConcurrency(Long containerConcurrency){
            this.containerConcurrency=containerConcurrency; return (A) this;
    }

    public Boolean hasContainerConcurrency(){
            return this.containerConcurrency != null;
    }

    public A addToContainers(int index,Container item){
            if (this.containers == null) {this.containers = new ArrayList();}
            ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("containers").add(index >= 0 ? index : _visitables.get("containers").size(), builder);this.containers.add(index >= 0 ? index : containers.size(), builder); return (A)this;
    }

    public A setToContainers(int index,Container item){
            if (this.containers == null) {this.containers = new ArrayList();}
            ContainerBuilder builder = new ContainerBuilder(item);
            if (index < 0 || index >= _visitables.get("containers").size()) { _visitables.get("containers").add(builder); } else { _visitables.get("containers").set(index, builder);}
            if (index < 0 || index >= containers.size()) { containers.add(builder); } else { containers.set(index, builder);}
             return (A)this;
    }

    public A addToContainers(Container... items){
            if (this.containers == null) {this.containers = new ArrayList();}
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("containers").add(builder);this.containers.add(builder);} return (A)this;
    }

    public A addAllToContainers(Collection items){
            if (this.containers == null) {this.containers = new ArrayList();}
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("containers").add(builder);this.containers.add(builder);} return (A)this;
    }

    public A removeFromContainers(Container... items){
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("containers").remove(builder);if (this.containers != null) {this.containers.remove(builder);}} return (A)this;
    }

    public A removeAllFromContainers(Collection items){
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("containers").remove(builder);if (this.containers != null) {this.containers.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromContainers(io.fabric8.kubernetes.api.builder.Predicate predicate){
            if (containers == null) return (A) this;
            final Iterator each = containers.iterator();
            final List visitables = _visitables.get("containers");
            while (each.hasNext()) {
              ContainerBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildContainers instead.
 * @return The buildable object.
 */
@java.lang.Deprecated public List getContainers(){
            return build(containers);
    }

    public List buildContainers(){
            return build(containers);
    }

    public Container buildContainer(int index){
            return this.containers.get(index).build();
    }

    public Container buildFirstContainer(){
            return this.containers.get(0).build();
    }

    public Container buildLastContainer(){
            return this.containers.get(containers.size() - 1).build();
    }

    public Container buildMatchingContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (ContainerBuilder item: containers) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (ContainerBuilder item: containers) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withContainers(List containers){
            if (this.containers != null) { _visitables.get("containers").removeAll(this.containers);}
            if (containers != null) {this.containers = new ArrayList(); for (Container item : containers){this.addToContainers(item);}} else { this.containers = null;} return (A) this;
    }

    public A withContainers(Container... containers){
            if (this.containers != null) {this.containers.clear();}
            if (containers != null) {for (Container item :containers){ this.addToContainers(item);}} return (A) this;
    }

    public Boolean hasContainers(){
            return containers != null && !containers.isEmpty();
    }

    public RevisionSpecFluent.ContainersNested addNewContainer(){
            return new ContainersNestedImpl();
    }

    public RevisionSpecFluent.ContainersNested addNewContainerLike(Container item){
            return new ContainersNestedImpl(-1, item);
    }

    public RevisionSpecFluent.ContainersNested setNewContainerLike(int index,Container item){
            return new ContainersNestedImpl(index, item);
    }

    public RevisionSpecFluent.ContainersNested editContainer(int index){
            if (containers.size() <= index) throw new RuntimeException("Can't edit containers. Index exceeds size.");
            return setNewContainerLike(index, buildContainer(index));
    }

    public RevisionSpecFluent.ContainersNested editFirstContainer(){
            if (containers.size() == 0) throw new RuntimeException("Can't edit first containers. The list is empty.");
            return setNewContainerLike(0, buildContainer(0));
    }

    public RevisionSpecFluent.ContainersNested editLastContainer(){
            int index = containers.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last containers. The list is empty.");
            return setNewContainerLike(index, buildContainer(index));
    }

    public RevisionSpecFluent.ContainersNested editMatchingContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i();}
            this.ephemeralContainers.add(index, item);
            return (A)this;
    }

    public A setToEphemeralContainers(int index,EphemeralContainer item){
            if (this.ephemeralContainers == null) {this.ephemeralContainers = new ArrayList();}
            this.ephemeralContainers.set(index, item); return (A)this;
    }

    public A addToEphemeralContainers(EphemeralContainer... items){
            if (this.ephemeralContainers == null) {this.ephemeralContainers = new ArrayList();}
            for (EphemeralContainer item : items) {this.ephemeralContainers.add(item);} return (A)this;
    }

    public A addAllToEphemeralContainers(Collection items){
            if (this.ephemeralContainers == null) {this.ephemeralContainers = new ArrayList();}
            for (EphemeralContainer item : items) {this.ephemeralContainers.add(item);} return (A)this;
    }

    public A removeFromEphemeralContainers(EphemeralContainer... items){
            for (EphemeralContainer item : items) {if (this.ephemeralContainers!= null){ this.ephemeralContainers.remove(item);}} return (A)this;
    }

    public A removeAllFromEphemeralContainers(Collection items){
            for (EphemeralContainer item : items) {if (this.ephemeralContainers!= null){ this.ephemeralContainers.remove(item);}} return (A)this;
    }

    public List getEphemeralContainers(){
            return this.ephemeralContainers;
    }

    public EphemeralContainer getEphemeralContainer(int index){
            return this.ephemeralContainers.get(index);
    }

    public EphemeralContainer getFirstEphemeralContainer(){
            return this.ephemeralContainers.get(0);
    }

    public EphemeralContainer getLastEphemeralContainer(){
            return this.ephemeralContainers.get(ephemeralContainers.size() - 1);
    }

    public EphemeralContainer getMatchingEphemeralContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (EphemeralContainer item: ephemeralContainers) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingEphemeralContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (EphemeralContainer item: ephemeralContainers) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withEphemeralContainers(List ephemeralContainers){
            if (this.ephemeralContainers != null) { _visitables.get("ephemeralContainers").removeAll(this.ephemeralContainers);}
            if (ephemeralContainers != null) {this.ephemeralContainers = new ArrayList(); for (EphemeralContainer item : ephemeralContainers){this.addToEphemeralContainers(item);}} else { this.ephemeralContainers = null;} return (A) this;
    }

    public A withEphemeralContainers(EphemeralContainer... ephemeralContainers){
            if (this.ephemeralContainers != null) {this.ephemeralContainers.clear();}
            if (ephemeralContainers != null) {for (EphemeralContainer item :ephemeralContainers){ this.addToEphemeralContainers(item);}} return (A) this;
    }

    public Boolean hasEphemeralContainers(){
            return ephemeralContainers != null && !ephemeralContainers.isEmpty();
    }

    public A addToHostAliases(int index,HostAlias item){
            if (this.hostAliases == null) {this.hostAliases = new ArrayList();}
            this.hostAliases.add(index, item);
            return (A)this;
    }

    public A setToHostAliases(int index,HostAlias item){
            if (this.hostAliases == null) {this.hostAliases = new ArrayList();}
            this.hostAliases.set(index, item); return (A)this;
    }

    public A addToHostAliases(HostAlias... items){
            if (this.hostAliases == null) {this.hostAliases = new ArrayList();}
            for (HostAlias item : items) {this.hostAliases.add(item);} return (A)this;
    }

    public A addAllToHostAliases(Collection items){
            if (this.hostAliases == null) {this.hostAliases = new ArrayList();}
            for (HostAlias item : items) {this.hostAliases.add(item);} return (A)this;
    }

    public A removeFromHostAliases(HostAlias... items){
            for (HostAlias item : items) {if (this.hostAliases!= null){ this.hostAliases.remove(item);}} return (A)this;
    }

    public A removeAllFromHostAliases(Collection items){
            for (HostAlias item : items) {if (this.hostAliases!= null){ this.hostAliases.remove(item);}} return (A)this;
    }

    public List getHostAliases(){
            return this.hostAliases;
    }

    public HostAlias getHostAlias(int index){
            return this.hostAliases.get(index);
    }

    public HostAlias getFirstHostAlias(){
            return this.hostAliases.get(0);
    }

    public HostAlias getLastHostAlias(){
            return this.hostAliases.get(hostAliases.size() - 1);
    }

    public HostAlias getMatchingHostAlias(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (HostAlias item: hostAliases) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingHostAlias(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (HostAlias item: hostAliases) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withHostAliases(List hostAliases){
            if (this.hostAliases != null) { _visitables.get("hostAliases").removeAll(this.hostAliases);}
            if (hostAliases != null) {this.hostAliases = new ArrayList(); for (HostAlias item : hostAliases){this.addToHostAliases(item);}} else { this.hostAliases = null;} return (A) this;
    }

    public A withHostAliases(HostAlias... hostAliases){
            if (this.hostAliases != null) {this.hostAliases.clear();}
            if (hostAliases != null) {for (HostAlias item :hostAliases){ this.addToHostAliases(item);}} return (A) this;
    }

    public Boolean hasHostAliases(){
            return hostAliases != null && !hostAliases.isEmpty();
    }

    public Boolean isHostIPC(){
            return this.hostIPC;
    }

    public A withHostIPC(Boolean hostIPC){
            this.hostIPC=hostIPC; return (A) this;
    }

    public Boolean hasHostIPC(){
            return this.hostIPC != null;
    }

    public A withNewHostIPC(String arg1){
            return (A)withHostIPC(new Boolean(arg1));
    }

    public A withNewHostIPC(boolean arg1){
            return (A)withHostIPC(new Boolean(arg1));
    }

    public Boolean isHostNetwork(){
            return this.hostNetwork;
    }

    public A withHostNetwork(Boolean hostNetwork){
            this.hostNetwork=hostNetwork; return (A) this;
    }

    public Boolean hasHostNetwork(){
            return this.hostNetwork != null;
    }

    public A withNewHostNetwork(String arg1){
            return (A)withHostNetwork(new Boolean(arg1));
    }

    public A withNewHostNetwork(boolean arg1){
            return (A)withHostNetwork(new Boolean(arg1));
    }

    public Boolean isHostPID(){
            return this.hostPID;
    }

    public A withHostPID(Boolean hostPID){
            this.hostPID=hostPID; return (A) this;
    }

    public Boolean hasHostPID(){
            return this.hostPID != null;
    }

    public A withNewHostPID(String arg1){
            return (A)withHostPID(new Boolean(arg1));
    }

    public A withNewHostPID(boolean arg1){
            return (A)withHostPID(new Boolean(arg1));
    }

    public String getHostname(){
            return this.hostname;
    }

    public A withHostname(String hostname){
            this.hostname=hostname; return (A) this;
    }

    public Boolean hasHostname(){
            return this.hostname != null;
    }

    public A withNewHostname(String arg1){
            return (A)withHostname(new String(arg1));
    }

    public A withNewHostname(StringBuilder arg1){
            return (A)withHostname(new String(arg1));
    }

    public A withNewHostname(StringBuffer arg1){
            return (A)withHostname(new String(arg1));
    }

    public A addToImagePullSecrets(int index,LocalObjectReference item){
            if (this.imagePullSecrets == null) {this.imagePullSecrets = new ArrayList();}
            this.imagePullSecrets.add(index, item);
            return (A)this;
    }

    public A setToImagePullSecrets(int index,LocalObjectReference item){
            if (this.imagePullSecrets == null) {this.imagePullSecrets = new ArrayList();}
            this.imagePullSecrets.set(index, item); return (A)this;
    }

    public A addToImagePullSecrets(LocalObjectReference... items){
            if (this.imagePullSecrets == null) {this.imagePullSecrets = new ArrayList();}
            for (LocalObjectReference item : items) {this.imagePullSecrets.add(item);} return (A)this;
    }

    public A addAllToImagePullSecrets(Collection items){
            if (this.imagePullSecrets == null) {this.imagePullSecrets = new ArrayList();}
            for (LocalObjectReference item : items) {this.imagePullSecrets.add(item);} return (A)this;
    }

    public A removeFromImagePullSecrets(LocalObjectReference... items){
            for (LocalObjectReference item : items) {if (this.imagePullSecrets!= null){ this.imagePullSecrets.remove(item);}} return (A)this;
    }

    public A removeAllFromImagePullSecrets(Collection items){
            for (LocalObjectReference item : items) {if (this.imagePullSecrets!= null){ this.imagePullSecrets.remove(item);}} return (A)this;
    }

    public List getImagePullSecrets(){
            return this.imagePullSecrets;
    }

    public LocalObjectReference getImagePullSecret(int index){
            return this.imagePullSecrets.get(index);
    }

    public LocalObjectReference getFirstImagePullSecret(){
            return this.imagePullSecrets.get(0);
    }

    public LocalObjectReference getLastImagePullSecret(){
            return this.imagePullSecrets.get(imagePullSecrets.size() - 1);
    }

    public LocalObjectReference getMatchingImagePullSecret(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (LocalObjectReference item: imagePullSecrets) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingImagePullSecret(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (LocalObjectReference item: imagePullSecrets) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withImagePullSecrets(List imagePullSecrets){
            if (this.imagePullSecrets != null) { _visitables.get("imagePullSecrets").removeAll(this.imagePullSecrets);}
            if (imagePullSecrets != null) {this.imagePullSecrets = new ArrayList(); for (LocalObjectReference item : imagePullSecrets){this.addToImagePullSecrets(item);}} else { this.imagePullSecrets = null;} return (A) this;
    }

    public A withImagePullSecrets(LocalObjectReference... imagePullSecrets){
            if (this.imagePullSecrets != null) {this.imagePullSecrets.clear();}
            if (imagePullSecrets != null) {for (LocalObjectReference item :imagePullSecrets){ this.addToImagePullSecrets(item);}} return (A) this;
    }

    public Boolean hasImagePullSecrets(){
            return imagePullSecrets != null && !imagePullSecrets.isEmpty();
    }

    public A addNewImagePullSecret(String name){
            return (A)addToImagePullSecrets(new LocalObjectReference(name));
    }

    public A addToInitContainers(int index,Container item){
            if (this.initContainers == null) {this.initContainers = new ArrayList();}
            ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("initContainers").add(index >= 0 ? index : _visitables.get("initContainers").size(), builder);this.initContainers.add(index >= 0 ? index : initContainers.size(), builder); return (A)this;
    }

    public A setToInitContainers(int index,Container item){
            if (this.initContainers == null) {this.initContainers = new ArrayList();}
            ContainerBuilder builder = new ContainerBuilder(item);
            if (index < 0 || index >= _visitables.get("initContainers").size()) { _visitables.get("initContainers").add(builder); } else { _visitables.get("initContainers").set(index, builder);}
            if (index < 0 || index >= initContainers.size()) { initContainers.add(builder); } else { initContainers.set(index, builder);}
             return (A)this;
    }

    public A addToInitContainers(Container... items){
            if (this.initContainers == null) {this.initContainers = new ArrayList();}
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("initContainers").add(builder);this.initContainers.add(builder);} return (A)this;
    }

    public A addAllToInitContainers(Collection items){
            if (this.initContainers == null) {this.initContainers = new ArrayList();}
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("initContainers").add(builder);this.initContainers.add(builder);} return (A)this;
    }

    public A removeFromInitContainers(Container... items){
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("initContainers").remove(builder);if (this.initContainers != null) {this.initContainers.remove(builder);}} return (A)this;
    }

    public A removeAllFromInitContainers(Collection items){
            for (Container item : items) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.get("initContainers").remove(builder);if (this.initContainers != null) {this.initContainers.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromInitContainers(io.fabric8.kubernetes.api.builder.Predicate predicate){
            if (initContainers == null) return (A) this;
            final Iterator each = initContainers.iterator();
            final List visitables = _visitables.get("initContainers");
            while (each.hasNext()) {
              ContainerBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildInitContainers instead.
 * @return The buildable object.
 */
@java.lang.Deprecated public List getInitContainers(){
            return build(initContainers);
    }

    public List buildInitContainers(){
            return build(initContainers);
    }

    public Container buildInitContainer(int index){
            return this.initContainers.get(index).build();
    }

    public Container buildFirstInitContainer(){
            return this.initContainers.get(0).build();
    }

    public Container buildLastInitContainer(){
            return this.initContainers.get(initContainers.size() - 1).build();
    }

    public Container buildMatchingInitContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (ContainerBuilder item: initContainers) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingInitContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (ContainerBuilder item: initContainers) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withInitContainers(List initContainers){
            if (this.initContainers != null) { _visitables.get("initContainers").removeAll(this.initContainers);}
            if (initContainers != null) {this.initContainers = new ArrayList(); for (Container item : initContainers){this.addToInitContainers(item);}} else { this.initContainers = null;} return (A) this;
    }

    public A withInitContainers(Container... initContainers){
            if (this.initContainers != null) {this.initContainers.clear();}
            if (initContainers != null) {for (Container item :initContainers){ this.addToInitContainers(item);}} return (A) this;
    }

    public Boolean hasInitContainers(){
            return initContainers != null && !initContainers.isEmpty();
    }

    public RevisionSpecFluent.InitContainersNested addNewInitContainer(){
            return new InitContainersNestedImpl();
    }

    public RevisionSpecFluent.InitContainersNested addNewInitContainerLike(Container item){
            return new InitContainersNestedImpl(-1, item);
    }

    public RevisionSpecFluent.InitContainersNested setNewInitContainerLike(int index,Container item){
            return new InitContainersNestedImpl(index, item);
    }

    public RevisionSpecFluent.InitContainersNested editInitContainer(int index){
            if (initContainers.size() <= index) throw new RuntimeException("Can't edit initContainers. Index exceeds size.");
            return setNewInitContainerLike(index, buildInitContainer(index));
    }

    public RevisionSpecFluent.InitContainersNested editFirstInitContainer(){
            if (initContainers.size() == 0) throw new RuntimeException("Can't edit first initContainers. The list is empty.");
            return setNewInitContainerLike(0, buildInitContainer(0));
    }

    public RevisionSpecFluent.InitContainersNested editLastInitContainer(){
            int index = initContainers.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last initContainers. The list is empty.");
            return setNewInitContainerLike(index, buildInitContainer(index));
    }

    public RevisionSpecFluent.InitContainersNested editMatchingInitContainer(io.fabric8.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i(); }
            if(key != null && value != null) {this.nodeSelector.put(key, value);} return (A)this;
    }

    public A addToNodeSelector(Map map){
            if(this.nodeSelector == null && map != null) { this.nodeSelector = new LinkedHashMap(); }
            if(map != null) { this.nodeSelector.putAll(map);} return (A)this;
    }

    public A removeFromNodeSelector(String key){
            if(this.nodeSelector == null) { return (A) this; }
            if(key != null && this.nodeSelector != null) {this.nodeSelector.remove(key);} return (A)this;
    }

    public A removeFromNodeSelector(Map map){
            if(this.nodeSelector == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.nodeSelector != null){this.nodeSelector.remove(key);}}} return (A)this;
    }

    public Map getNodeSelector(){
            return this.nodeSelector;
    }

    public A withNodeSelector(Map nodeSelector){
            if (nodeSelector == null) { this.nodeSelector =  null;} else {this.nodeSelector = new LinkedHashMap(nodeSelector);} return (A) this;
    }

    public Boolean hasNodeSelector(){
            return this.nodeSelector != null;
    }

    public A addToOverhead(String key,Quantity value){
            if(this.overhead == null && key != null && value != null) { this.overhead = new LinkedHashMap(); }
            if(key != null && value != null) {this.overhead.put(key, value);} return (A)this;
    }

    public A addToOverhead(Map map){
            if(this.overhead == null && map != null) { this.overhead = new LinkedHashMap(); }
            if(map != null) { this.overhead.putAll(map);} return (A)this;
    }

    public A removeFromOverhead(String key){
            if(this.overhead == null) { return (A) this; }
            if(key != null && this.overhead != null) {this.overhead.remove(key);} return (A)this;
    }

    public A removeFromOverhead(Map map){
            if(this.overhead == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.overhead != null){this.overhead.remove(key);}}} return (A)this;
    }

    public Map getOverhead(){
            return this.overhead;
    }

    public A withOverhead(Map overhead){
            if (overhead == null) { this.overhead =  null;} else {this.overhead = new LinkedHashMap(overhead);} return (A) this;
    }

    public Boolean hasOverhead(){
            return this.overhead != null;
    }

    public String getPreemptionPolicy(){
            return this.preemptionPolicy;
    }

    public A withPreemptionPolicy(String preemptionPolicy){
            this.preemptionPolicy=preemptionPolicy; return (A) this;
    }

    public Boolean hasPreemptionPolicy(){
            return this.preemptionPolicy != null;
    }

    public A withNewPreemptionPolicy(String arg1){
            return (A)withPreemptionPolicy(new String(arg1));
    }

    public A withNewPreemptionPolicy(StringBuilder arg1){
            return (A)withPreemptionPolicy(new String(arg1));
    }

    public A withNewPreemptionPolicy(StringBuffer arg1){
            return (A)withPreemptionPolicy(new String(arg1));
    }

    public Integer getPriority(){
            return this.priority;
    }

    public A withPriority(Integer priority){
            this.priority=priority; return (A) this;
    }

    public Boolean hasPriority(){
            return this.priority != null;
    }

    public String getPriorityClassName(){
            return this.priorityClassName;
    }

    public A withPriorityClassName(String priorityClassName){
            this.priorityClassName=priorityClassName; return (A) this;
    }

    public Boolean hasPriorityClassName(){
            return this.priorityClassName != null;
    }

    public A withNewPriorityClassName(String arg1){
            return (A)withPriorityClassName(new String(arg1));
    }

    public A withNewPriorityClassName(StringBuilder arg1){
            return (A)withPriorityClassName(new String(arg1));
    }

    public A withNewPriorityClassName(StringBuffer arg1){
            return (A)withPriorityClassName(new String(arg1));
    }

    public A addToReadinessGates(int index,PodReadinessGate item){
            if (this.readinessGates == null) {this.readinessGates = new ArrayList();}
            this.readinessGates.add(index, item);
            return (A)this;
    }

    public A setToReadinessGates(int index,PodReadinessGate item){
            if (this.readinessGates == null) {this.readinessGates = new ArrayList();}
            this.readinessGates.set(index, item); return (A)this;
    }

    public A addToReadinessGates(PodReadinessGate... items){
            if (this.readinessGates == null) {this.readinessGates = new ArrayList();}
            for (PodReadinessGate item : items) {this.readinessGates.add(item);} return (A)this;
    }

    public A addAllToReadinessGates(Collection items){
            if (this.readinessGates == null) {this.readinessGates = new ArrayList();}
            for (PodReadinessGate item : items) {this.readinessGates.add(item);} return (A)this;
    }

    public A removeFromReadinessGates(PodReadinessGate... items){
            for (PodReadinessGate item : items) {if (this.readinessGates!= null){ this.readinessGates.remove(item);}} return (A)this;
    }

    public A removeAllFromReadinessGates(Collection items){
            for (PodReadinessGate item : items) {if (this.readinessGates!= null){ this.readinessGates.remove(item);}} return (A)this;
    }

    public List getReadinessGates(){
            return this.readinessGates;
    }

    public PodReadinessGate getReadinessGate(int index){
            return this.readinessGates.get(index);
    }

    public PodReadinessGate getFirstReadinessGate(){
            return this.readinessGates.get(0);
    }

    public PodReadinessGate getLastReadinessGate(){
            return this.readinessGates.get(readinessGates.size() - 1);
    }

    public PodReadinessGate getMatchingReadinessGate(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (PodReadinessGate item: readinessGates) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingReadinessGate(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (PodReadinessGate item: readinessGates) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withReadinessGates(List readinessGates){
            if (this.readinessGates != null) { _visitables.get("readinessGates").removeAll(this.readinessGates);}
            if (readinessGates != null) {this.readinessGates = new ArrayList(); for (PodReadinessGate item : readinessGates){this.addToReadinessGates(item);}} else { this.readinessGates = null;} return (A) this;
    }

    public A withReadinessGates(PodReadinessGate... readinessGates){
            if (this.readinessGates != null) {this.readinessGates.clear();}
            if (readinessGates != null) {for (PodReadinessGate item :readinessGates){ this.addToReadinessGates(item);}} return (A) this;
    }

    public Boolean hasReadinessGates(){
            return readinessGates != null && !readinessGates.isEmpty();
    }

    public A addNewReadinessGate(String conditionType){
            return (A)addToReadinessGates(new PodReadinessGate(conditionType));
    }

    public String getRestartPolicy(){
            return this.restartPolicy;
    }

    public A withRestartPolicy(String restartPolicy){
            this.restartPolicy=restartPolicy; return (A) this;
    }

    public Boolean hasRestartPolicy(){
            return this.restartPolicy != null;
    }

    public A withNewRestartPolicy(String arg1){
            return (A)withRestartPolicy(new String(arg1));
    }

    public A withNewRestartPolicy(StringBuilder arg1){
            return (A)withRestartPolicy(new String(arg1));
    }

    public A withNewRestartPolicy(StringBuffer arg1){
            return (A)withRestartPolicy(new String(arg1));
    }

    public String getRuntimeClassName(){
            return this.runtimeClassName;
    }

    public A withRuntimeClassName(String runtimeClassName){
            this.runtimeClassName=runtimeClassName; return (A) this;
    }

    public Boolean hasRuntimeClassName(){
            return this.runtimeClassName != null;
    }

    public A withNewRuntimeClassName(String arg1){
            return (A)withRuntimeClassName(new String(arg1));
    }

    public A withNewRuntimeClassName(StringBuilder arg1){
            return (A)withRuntimeClassName(new String(arg1));
    }

    public A withNewRuntimeClassName(StringBuffer arg1){
            return (A)withRuntimeClassName(new String(arg1));
    }

    public String getSchedulerName(){
            return this.schedulerName;
    }

    public A withSchedulerName(String schedulerName){
            this.schedulerName=schedulerName; return (A) this;
    }

    public Boolean hasSchedulerName(){
            return this.schedulerName != null;
    }

    public A withNewSchedulerName(String arg1){
            return (A)withSchedulerName(new String(arg1));
    }

    public A withNewSchedulerName(StringBuilder arg1){
            return (A)withSchedulerName(new String(arg1));
    }

    public A withNewSchedulerName(StringBuffer arg1){
            return (A)withSchedulerName(new String(arg1));
    }

    public PodSecurityContext getSecurityContext(){
            return this.securityContext;
    }

    public A withSecurityContext(PodSecurityContext securityContext){
            this.securityContext=securityContext; return (A) this;
    }

    public Boolean hasSecurityContext(){
            return this.securityContext != null;
    }

    public String getServiceAccount(){
            return this.serviceAccount;
    }

    public A withServiceAccount(String serviceAccount){
            this.serviceAccount=serviceAccount; return (A) this;
    }

    public Boolean hasServiceAccount(){
            return this.serviceAccount != null;
    }

    public A withNewServiceAccount(String arg1){
            return (A)withServiceAccount(new String(arg1));
    }

    public A withNewServiceAccount(StringBuilder arg1){
            return (A)withServiceAccount(new String(arg1));
    }

    public A withNewServiceAccount(StringBuffer arg1){
            return (A)withServiceAccount(new String(arg1));
    }

    public String getServiceAccountName(){
            return this.serviceAccountName;
    }

    public A withServiceAccountName(String serviceAccountName){
            this.serviceAccountName=serviceAccountName; return (A) this;
    }

    public Boolean hasServiceAccountName(){
            return this.serviceAccountName != null;
    }

    public A withNewServiceAccountName(String arg1){
            return (A)withServiceAccountName(new String(arg1));
    }

    public A withNewServiceAccountName(StringBuilder arg1){
            return (A)withServiceAccountName(new String(arg1));
    }

    public A withNewServiceAccountName(StringBuffer arg1){
            return (A)withServiceAccountName(new String(arg1));
    }

    public Boolean isShareProcessNamespace(){
            return this.shareProcessNamespace;
    }

    public A withShareProcessNamespace(Boolean shareProcessNamespace){
            this.shareProcessNamespace=shareProcessNamespace; return (A) this;
    }

    public Boolean hasShareProcessNamespace(){
            return this.shareProcessNamespace != null;
    }

    public A withNewShareProcessNamespace(String arg1){
            return (A)withShareProcessNamespace(new Boolean(arg1));
    }

    public A withNewShareProcessNamespace(boolean arg1){
            return (A)withShareProcessNamespace(new Boolean(arg1));
    }

    public String getSubdomain(){
            return this.subdomain;
    }

    public A withSubdomain(String subdomain){
            this.subdomain=subdomain; return (A) this;
    }

    public Boolean hasSubdomain(){
            return this.subdomain != null;
    }

    public A withNewSubdomain(String arg1){
            return (A)withSubdomain(new String(arg1));
    }

    public A withNewSubdomain(StringBuilder arg1){
            return (A)withSubdomain(new String(arg1));
    }

    public A withNewSubdomain(StringBuffer arg1){
            return (A)withSubdomain(new String(arg1));
    }

    public Long getTerminationGracePeriodSeconds(){
            return this.terminationGracePeriodSeconds;
    }

    public A withTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds){
            this.terminationGracePeriodSeconds=terminationGracePeriodSeconds; return (A) this;
    }

    public Boolean hasTerminationGracePeriodSeconds(){
            return this.terminationGracePeriodSeconds != null;
    }

    public Long getTimeoutSeconds(){
            return this.timeoutSeconds;
    }

    public A withTimeoutSeconds(Long timeoutSeconds){
            this.timeoutSeconds=timeoutSeconds; return (A) this;
    }

    public Boolean hasTimeoutSeconds(){
            return this.timeoutSeconds != null;
    }

    public A addToTolerations(int index,Toleration item){
            if (this.tolerations == null) {this.tolerations = new ArrayList();}
            this.tolerations.add(index, item);
            return (A)this;
    }

    public A setToTolerations(int index,Toleration item){
            if (this.tolerations == null) {this.tolerations = new ArrayList();}
            this.tolerations.set(index, item); return (A)this;
    }

    public A addToTolerations(Toleration... items){
            if (this.tolerations == null) {this.tolerations = new ArrayList();}
            for (Toleration item : items) {this.tolerations.add(item);} return (A)this;
    }

    public A addAllToTolerations(Collection items){
            if (this.tolerations == null) {this.tolerations = new ArrayList();}
            for (Toleration item : items) {this.tolerations.add(item);} return (A)this;
    }

    public A removeFromTolerations(Toleration... items){
            for (Toleration item : items) {if (this.tolerations!= null){ this.tolerations.remove(item);}} return (A)this;
    }

    public A removeAllFromTolerations(Collection items){
            for (Toleration item : items) {if (this.tolerations!= null){ this.tolerations.remove(item);}} return (A)this;
    }

    public List getTolerations(){
            return this.tolerations;
    }

    public Toleration getToleration(int index){
            return this.tolerations.get(index);
    }

    public Toleration getFirstToleration(){
            return this.tolerations.get(0);
    }

    public Toleration getLastToleration(){
            return this.tolerations.get(tolerations.size() - 1);
    }

    public Toleration getMatchingToleration(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (Toleration item: tolerations) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingToleration(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (Toleration item: tolerations) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withTolerations(List tolerations){
            if (this.tolerations != null) { _visitables.get("tolerations").removeAll(this.tolerations);}
            if (tolerations != null) {this.tolerations = new ArrayList(); for (Toleration item : tolerations){this.addToTolerations(item);}} else { this.tolerations = null;} return (A) this;
    }

    public A withTolerations(Toleration... tolerations){
            if (this.tolerations != null) {this.tolerations.clear();}
            if (tolerations != null) {for (Toleration item :tolerations){ this.addToTolerations(item);}} return (A) this;
    }

    public Boolean hasTolerations(){
            return tolerations != null && !tolerations.isEmpty();
    }

    public A addNewToleration(String effect,String key,String operator,Long tolerationSeconds,String value){
            return (A)addToTolerations(new Toleration(effect, key, operator, tolerationSeconds, value));
    }

    public A addToTopologySpreadConstraints(int index,TopologySpreadConstraint item){
            if (this.topologySpreadConstraints == null) {this.topologySpreadConstraints = new ArrayList();}
            this.topologySpreadConstraints.add(index, item);
            return (A)this;
    }

    public A setToTopologySpreadConstraints(int index,TopologySpreadConstraint item){
            if (this.topologySpreadConstraints == null) {this.topologySpreadConstraints = new ArrayList();}
            this.topologySpreadConstraints.set(index, item); return (A)this;
    }

    public A addToTopologySpreadConstraints(TopologySpreadConstraint... items){
            if (this.topologySpreadConstraints == null) {this.topologySpreadConstraints = new ArrayList();}
            for (TopologySpreadConstraint item : items) {this.topologySpreadConstraints.add(item);} return (A)this;
    }

    public A addAllToTopologySpreadConstraints(Collection items){
            if (this.topologySpreadConstraints == null) {this.topologySpreadConstraints = new ArrayList();}
            for (TopologySpreadConstraint item : items) {this.topologySpreadConstraints.add(item);} return (A)this;
    }

    public A removeFromTopologySpreadConstraints(TopologySpreadConstraint... items){
            for (TopologySpreadConstraint item : items) {if (this.topologySpreadConstraints!= null){ this.topologySpreadConstraints.remove(item);}} return (A)this;
    }

    public A removeAllFromTopologySpreadConstraints(Collection items){
            for (TopologySpreadConstraint item : items) {if (this.topologySpreadConstraints!= null){ this.topologySpreadConstraints.remove(item);}} return (A)this;
    }

    public List getTopologySpreadConstraints(){
            return this.topologySpreadConstraints;
    }

    public TopologySpreadConstraint getTopologySpreadConstraint(int index){
            return this.topologySpreadConstraints.get(index);
    }

    public TopologySpreadConstraint getFirstTopologySpreadConstraint(){
            return this.topologySpreadConstraints.get(0);
    }

    public TopologySpreadConstraint getLastTopologySpreadConstraint(){
            return this.topologySpreadConstraints.get(topologySpreadConstraints.size() - 1);
    }

    public TopologySpreadConstraint getMatchingTopologySpreadConstraint(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (TopologySpreadConstraint item: topologySpreadConstraints) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingTopologySpreadConstraint(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (TopologySpreadConstraint item: topologySpreadConstraints) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withTopologySpreadConstraints(List topologySpreadConstraints){
            if (this.topologySpreadConstraints != null) { _visitables.get("topologySpreadConstraints").removeAll(this.topologySpreadConstraints);}
            if (topologySpreadConstraints != null) {this.topologySpreadConstraints = new ArrayList(); for (TopologySpreadConstraint item : topologySpreadConstraints){this.addToTopologySpreadConstraints(item);}} else { this.topologySpreadConstraints = null;} return (A) this;
    }

    public A withTopologySpreadConstraints(TopologySpreadConstraint... topologySpreadConstraints){
            if (this.topologySpreadConstraints != null) {this.topologySpreadConstraints.clear();}
            if (topologySpreadConstraints != null) {for (TopologySpreadConstraint item :topologySpreadConstraints){ this.addToTopologySpreadConstraints(item);}} return (A) this;
    }

    public Boolean hasTopologySpreadConstraints(){
            return topologySpreadConstraints != null && !topologySpreadConstraints.isEmpty();
    }

    public A addToVolumes(int index,Volume item){
            if (this.volumes == null) {this.volumes = new ArrayList();}
            VolumeBuilder builder = new VolumeBuilder(item);_visitables.get("volumes").add(index >= 0 ? index : _visitables.get("volumes").size(), builder);this.volumes.add(index >= 0 ? index : volumes.size(), builder); return (A)this;
    }

    public A setToVolumes(int index,Volume item){
            if (this.volumes == null) {this.volumes = new ArrayList();}
            VolumeBuilder builder = new VolumeBuilder(item);
            if (index < 0 || index >= _visitables.get("volumes").size()) { _visitables.get("volumes").add(builder); } else { _visitables.get("volumes").set(index, builder);}
            if (index < 0 || index >= volumes.size()) { volumes.add(builder); } else { volumes.set(index, builder);}
             return (A)this;
    }

    public A addToVolumes(Volume... items){
            if (this.volumes == null) {this.volumes = new ArrayList();}
            for (Volume item : items) {VolumeBuilder builder = new VolumeBuilder(item);_visitables.get("volumes").add(builder);this.volumes.add(builder);} return (A)this;
    }

    public A addAllToVolumes(Collection items){
            if (this.volumes == null) {this.volumes = new ArrayList();}
            for (Volume item : items) {VolumeBuilder builder = new VolumeBuilder(item);_visitables.get("volumes").add(builder);this.volumes.add(builder);} return (A)this;
    }

    public A removeFromVolumes(Volume... items){
            for (Volume item : items) {VolumeBuilder builder = new VolumeBuilder(item);_visitables.get("volumes").remove(builder);if (this.volumes != null) {this.volumes.remove(builder);}} return (A)this;
    }

    public A removeAllFromVolumes(Collection items){
            for (Volume item : items) {VolumeBuilder builder = new VolumeBuilder(item);_visitables.get("volumes").remove(builder);if (this.volumes != null) {this.volumes.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromVolumes(io.fabric8.kubernetes.api.builder.Predicate predicate){
            if (volumes == null) return (A) this;
            final Iterator each = volumes.iterator();
            final List visitables = _visitables.get("volumes");
            while (each.hasNext()) {
              VolumeBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildVolumes instead.
 * @return The buildable object.
 */
@java.lang.Deprecated public List getVolumes(){
            return build(volumes);
    }

    public List buildVolumes(){
            return build(volumes);
    }

    public Volume buildVolume(int index){
            return this.volumes.get(index).build();
    }

    public Volume buildFirstVolume(){
            return this.volumes.get(0).build();
    }

    public Volume buildLastVolume(){
            return this.volumes.get(volumes.size() - 1).build();
    }

    public Volume buildMatchingVolume(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (VolumeBuilder item: volumes) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingVolume(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (VolumeBuilder item: volumes) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withVolumes(List volumes){
            if (this.volumes != null) { _visitables.get("volumes").removeAll(this.volumes);}
            if (volumes != null) {this.volumes = new ArrayList(); for (Volume item : volumes){this.addToVolumes(item);}} else { this.volumes = null;} return (A) this;
    }

    public A withVolumes(Volume... volumes){
            if (this.volumes != null) {this.volumes.clear();}
            if (volumes != null) {for (Volume item :volumes){ this.addToVolumes(item);}} return (A) this;
    }

    public Boolean hasVolumes(){
            return volumes != null && !volumes.isEmpty();
    }

    public RevisionSpecFluent.VolumesNested addNewVolume(){
            return new VolumesNestedImpl();
    }

    public RevisionSpecFluent.VolumesNested addNewVolumeLike(Volume item){
            return new VolumesNestedImpl(-1, item);
    }

    public RevisionSpecFluent.VolumesNested setNewVolumeLike(int index,Volume item){
            return new VolumesNestedImpl(index, item);
    }

    public RevisionSpecFluent.VolumesNested editVolume(int index){
            if (volumes.size() <= index) throw new RuntimeException("Can't edit volumes. Index exceeds size.");
            return setNewVolumeLike(index, buildVolume(index));
    }

    public RevisionSpecFluent.VolumesNested editFirstVolume(){
            if (volumes.size() == 0) throw new RuntimeException("Can't edit first volumes. The list is empty.");
            return setNewVolumeLike(0, buildVolume(0));
    }

    public RevisionSpecFluent.VolumesNested editLastVolume(){
            int index = volumes.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last volumes. The list is empty.");
            return setNewVolumeLike(index, buildVolume(index));
    }

    public RevisionSpecFluent.VolumesNested editMatchingVolume(io.fabric8.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i extends ContainerFluentImpl> implements RevisionSpecFluent.ContainersNested,io.fabric8.kubernetes.api.builder.Nested{

            private final ContainerBuilder builder;
        private final int index;
    
            ContainersNestedImpl(int index,Container item){
                    this.index = index;
                    this.builder = new ContainerBuilder(this, item);
            }
            ContainersNestedImpl(){
                    this.index = -1;
                    this.builder = new ContainerBuilder(this);
            }
    
    public N and(){
            return (N) RevisionSpecFluentImpl.this.setToContainers(index,builder.build());
    }
    public N endContainer(){
            return and();
    }

}
    public class InitContainersNestedImpl extends ContainerFluentImpl> implements RevisionSpecFluent.InitContainersNested,io.fabric8.kubernetes.api.builder.Nested{

            private final ContainerBuilder builder;
        private final int index;
    
            InitContainersNestedImpl(int index,Container item){
                    this.index = index;
                    this.builder = new ContainerBuilder(this, item);
            }
            InitContainersNestedImpl(){
                    this.index = -1;
                    this.builder = new ContainerBuilder(this);
            }
    
    public N and(){
            return (N) RevisionSpecFluentImpl.this.setToInitContainers(index,builder.build());
    }
    public N endInitContainer(){
            return and();
    }

}
    public class VolumesNestedImpl extends VolumeFluentImpl> implements RevisionSpecFluent.VolumesNested,io.fabric8.kubernetes.api.builder.Nested{

            private final VolumeBuilder builder;
        private final int index;
    
            VolumesNestedImpl(int index,Volume item){
                    this.index = index;
                    this.builder = new VolumeBuilder(this, item);
            }
            VolumesNestedImpl(){
                    this.index = -1;
                    this.builder = new VolumeBuilder(this);
            }
    
    public N and(){
            return (N) RevisionSpecFluentImpl.this.setToVolumes(index,builder.build());
    }
    public N endVolume(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy