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

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

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

import io.kubernetes.client.fluent.VisitableBuilder;
import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import java.lang.StringBuffer;
import java.time.OffsetDateTime;
import java.util.Collection;
import java.lang.Object;

public class V1PodStatusFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1PodStatusFluent {

    private List conditions;
    private List containerStatuses;
    private List ephemeralContainerStatuses;
    private String hostIP;
    private List initContainerStatuses;
    private String message;
    private String nominatedNodeName;
    private String phase;
    private String podIP;
    private List podIPs;
    private String qosClass;
    private String reason;
    private OffsetDateTime startTime;

    public V1PodStatusFluentImpl() { 
    }


    public V1PodStatusFluentImpl(V1PodStatus instance) { 
        this.withConditions(instance.getConditions());

        this.withContainerStatuses(instance.getContainerStatuses());

        this.withEphemeralContainerStatuses(instance.getEphemeralContainerStatuses());

        this.withHostIP(instance.getHostIP());

        this.withInitContainerStatuses(instance.getInitContainerStatuses());

        this.withMessage(instance.getMessage());

        this.withNominatedNodeName(instance.getNominatedNodeName());

        this.withPhase(instance.getPhase());

        this.withPodIP(instance.getPodIP());

        this.withPodIPs(instance.getPodIPs());

        this.withQosClass(instance.getQosClass());

        this.withReason(instance.getReason());

        this.withStartTime(instance.getStartTime());

    }


    public A addToConditions(int index,V1PodCondition item) {
        if (this.conditions == null) {this.conditions = new ArrayList();}
        V1PodConditionBuilder builder = new V1PodConditionBuilder(item);_visitables.get("conditions").add(index >= 0 ? index : _visitables.get("conditions").size(), builder);this.conditions.add(index >= 0 ? index : conditions.size(), builder); return (A)this;
    }

    public A setToConditions(int index,V1PodCondition item) {
        if (this.conditions == null) {this.conditions = new ArrayList();}
        V1PodConditionBuilder builder = new V1PodConditionBuilder(item);
        if (index < 0 || index >= _visitables.get("conditions").size()) { _visitables.get("conditions").add(builder); } else { _visitables.get("conditions").set(index, builder);}
        if (index < 0 || index >= conditions.size()) { conditions.add(builder); } else { conditions.set(index, builder);}
         return (A)this;
    }

    public A addToConditions(V1PodCondition... items) {
        if (this.conditions == null) {this.conditions = new ArrayList();}
        for (V1PodCondition item : items) {V1PodConditionBuilder builder = new V1PodConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
    }

    public A addAllToConditions(Collection items) {
        if (this.conditions == null) {this.conditions = new ArrayList();}
        for (V1PodCondition item : items) {V1PodConditionBuilder builder = new V1PodConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
    }

    public A removeFromConditions(V1PodCondition... items) {
        for (V1PodCondition item : items) {V1PodConditionBuilder builder = new V1PodConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
    }

    public A removeAllFromConditions(Collection items) {
        for (V1PodCondition item : items) {V1PodConditionBuilder builder = new V1PodConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromConditions(io.kubernetes.client.fluent.Predicate predicate) {
        if (conditions == null) return (A) this;
        final Iterator each = conditions.iterator();
        final List visitables = _visitables.get("conditions");
        while (each.hasNext()) {
          V1PodConditionBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildConditions instead.
 * @return The buildable object.
 */
@Deprecated public List getConditions() {
        return build(conditions);
    }

    public List buildConditions() {
        return build(conditions);
    }

    public V1PodCondition buildCondition(int index) {
        return this.conditions.get(index).build();
    }

    public V1PodCondition buildFirstCondition() {
        return this.conditions.get(0).build();
    }

    public V1PodCondition buildLastCondition() {
        return this.conditions.get(conditions.size() - 1).build();
    }

    public V1PodCondition buildMatchingCondition(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1PodConditionBuilder item: conditions) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingCondition(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1PodConditionBuilder item: conditions) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withConditions(List conditions) {
        if (this.conditions != null) { _visitables.get("conditions").removeAll(this.conditions);}
        if (conditions != null) {this.conditions = new ArrayList(); for (V1PodCondition item : conditions){this.addToConditions(item);}} else { this.conditions = null;} return (A) this;
    }

    public A withConditions(V1PodCondition... conditions) {
        if (this.conditions != null) {this.conditions.clear();}
        if (conditions != null) {for (V1PodCondition item :conditions){ this.addToConditions(item);}} return (A) this;
    }

    public Boolean hasConditions() {
        return conditions != null && !conditions.isEmpty();
    }

    public V1PodStatusFluent.ConditionsNested addNewCondition() {
        return new ConditionsNestedImpl();
    }

    public V1PodStatusFluent.ConditionsNested addNewConditionLike(V1PodCondition item) {
        return new ConditionsNestedImpl(-1, item);
    }

    public V1PodStatusFluent.ConditionsNested setNewConditionLike(int index,V1PodCondition item) {
        return new ConditionsNestedImpl(index, item);
    }

    public V1PodStatusFluent.ConditionsNested editCondition(int index) {
        if (conditions.size() <= index) throw new RuntimeException("Can't edit conditions. Index exceeds size.");
        return setNewConditionLike(index, buildCondition(index));
    }

    public V1PodStatusFluent.ConditionsNested editFirstCondition() {
        if (conditions.size() == 0) throw new RuntimeException("Can't edit first conditions. The list is empty.");
        return setNewConditionLike(0, buildCondition(0));
    }

    public V1PodStatusFluent.ConditionsNested editLastCondition() {
        int index = conditions.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last conditions. The list is empty.");
        return setNewConditionLike(index, buildCondition(index));
    }

    public V1PodStatusFluent.ConditionsNested editMatchingCondition(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("containerStatuses").add(index >= 0 ? index : _visitables.get("containerStatuses").size(), builder);this.containerStatuses.add(index >= 0 ? index : containerStatuses.size(), builder); return (A)this;
    }

    public A setToContainerStatuses(int index,V1ContainerStatus item) {
        if (this.containerStatuses == null) {this.containerStatuses = new ArrayList();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);
        if (index < 0 || index >= _visitables.get("containerStatuses").size()) { _visitables.get("containerStatuses").add(builder); } else { _visitables.get("containerStatuses").set(index, builder);}
        if (index < 0 || index >= containerStatuses.size()) { containerStatuses.add(builder); } else { containerStatuses.set(index, builder);}
         return (A)this;
    }

    public A addToContainerStatuses(V1ContainerStatus... items) {
        if (this.containerStatuses == null) {this.containerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("containerStatuses").add(builder);this.containerStatuses.add(builder);} return (A)this;
    }

    public A addAllToContainerStatuses(Collection items) {
        if (this.containerStatuses == null) {this.containerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("containerStatuses").add(builder);this.containerStatuses.add(builder);} return (A)this;
    }

    public A removeFromContainerStatuses(V1ContainerStatus... items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("containerStatuses").remove(builder);if (this.containerStatuses != null) {this.containerStatuses.remove(builder);}} return (A)this;
    }

    public A removeAllFromContainerStatuses(Collection items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("containerStatuses").remove(builder);if (this.containerStatuses != null) {this.containerStatuses.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromContainerStatuses(io.kubernetes.client.fluent.Predicate predicate) {
        if (containerStatuses == null) return (A) this;
        final Iterator each = containerStatuses.iterator();
        final List visitables = _visitables.get("containerStatuses");
        while (each.hasNext()) {
          V1ContainerStatusBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildContainerStatuses instead.
 * @return The buildable object.
 */
@Deprecated public List getContainerStatuses() {
        return build(containerStatuses);
    }

    public List buildContainerStatuses() {
        return build(containerStatuses);
    }

    public V1ContainerStatus buildContainerStatus(int index) {
        return this.containerStatuses.get(index).build();
    }

    public V1ContainerStatus buildFirstContainerStatus() {
        return this.containerStatuses.get(0).build();
    }

    public V1ContainerStatus buildLastContainerStatus() {
        return this.containerStatuses.get(containerStatuses.size() - 1).build();
    }

    public V1ContainerStatus buildMatchingContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: containerStatuses) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: containerStatuses) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withContainerStatuses(List containerStatuses) {
        if (this.containerStatuses != null) { _visitables.get("containerStatuses").removeAll(this.containerStatuses);}
        if (containerStatuses != null) {this.containerStatuses = new ArrayList(); for (V1ContainerStatus item : containerStatuses){this.addToContainerStatuses(item);}} else { this.containerStatuses = null;} return (A) this;
    }

    public A withContainerStatuses(V1ContainerStatus... containerStatuses) {
        if (this.containerStatuses != null) {this.containerStatuses.clear();}
        if (containerStatuses != null) {for (V1ContainerStatus item :containerStatuses){ this.addToContainerStatuses(item);}} return (A) this;
    }

    public Boolean hasContainerStatuses() {
        return containerStatuses != null && !containerStatuses.isEmpty();
    }

    public V1PodStatusFluent.ContainerStatusesNested addNewContainerStatus() {
        return new ContainerStatusesNestedImpl();
    }

    public V1PodStatusFluent.ContainerStatusesNested addNewContainerStatusLike(V1ContainerStatus item) {
        return new ContainerStatusesNestedImpl(-1, item);
    }

    public V1PodStatusFluent.ContainerStatusesNested setNewContainerStatusLike(int index,V1ContainerStatus item) {
        return new ContainerStatusesNestedImpl(index, item);
    }

    public V1PodStatusFluent.ContainerStatusesNested editContainerStatus(int index) {
        if (containerStatuses.size() <= index) throw new RuntimeException("Can't edit containerStatuses. Index exceeds size.");
        return setNewContainerStatusLike(index, buildContainerStatus(index));
    }

    public V1PodStatusFluent.ContainerStatusesNested editFirstContainerStatus() {
        if (containerStatuses.size() == 0) throw new RuntimeException("Can't edit first containerStatuses. The list is empty.");
        return setNewContainerStatusLike(0, buildContainerStatus(0));
    }

    public V1PodStatusFluent.ContainerStatusesNested editLastContainerStatus() {
        int index = containerStatuses.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last containerStatuses. The list is empty.");
        return setNewContainerStatusLike(index, buildContainerStatus(index));
    }

    public V1PodStatusFluent.ContainerStatusesNested editMatchingContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("ephemeralContainerStatuses").add(index >= 0 ? index : _visitables.get("ephemeralContainerStatuses").size(), builder);this.ephemeralContainerStatuses.add(index >= 0 ? index : ephemeralContainerStatuses.size(), builder); return (A)this;
    }

    public A setToEphemeralContainerStatuses(int index,V1ContainerStatus item) {
        if (this.ephemeralContainerStatuses == null) {this.ephemeralContainerStatuses = new ArrayList();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);
        if (index < 0 || index >= _visitables.get("ephemeralContainerStatuses").size()) { _visitables.get("ephemeralContainerStatuses").add(builder); } else { _visitables.get("ephemeralContainerStatuses").set(index, builder);}
        if (index < 0 || index >= ephemeralContainerStatuses.size()) { ephemeralContainerStatuses.add(builder); } else { ephemeralContainerStatuses.set(index, builder);}
         return (A)this;
    }

    public A addToEphemeralContainerStatuses(V1ContainerStatus... items) {
        if (this.ephemeralContainerStatuses == null) {this.ephemeralContainerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("ephemeralContainerStatuses").add(builder);this.ephemeralContainerStatuses.add(builder);} return (A)this;
    }

    public A addAllToEphemeralContainerStatuses(Collection items) {
        if (this.ephemeralContainerStatuses == null) {this.ephemeralContainerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("ephemeralContainerStatuses").add(builder);this.ephemeralContainerStatuses.add(builder);} return (A)this;
    }

    public A removeFromEphemeralContainerStatuses(V1ContainerStatus... items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("ephemeralContainerStatuses").remove(builder);if (this.ephemeralContainerStatuses != null) {this.ephemeralContainerStatuses.remove(builder);}} return (A)this;
    }

    public A removeAllFromEphemeralContainerStatuses(Collection items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("ephemeralContainerStatuses").remove(builder);if (this.ephemeralContainerStatuses != null) {this.ephemeralContainerStatuses.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromEphemeralContainerStatuses(io.kubernetes.client.fluent.Predicate predicate) {
        if (ephemeralContainerStatuses == null) return (A) this;
        final Iterator each = ephemeralContainerStatuses.iterator();
        final List visitables = _visitables.get("ephemeralContainerStatuses");
        while (each.hasNext()) {
          V1ContainerStatusBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildEphemeralContainerStatuses instead.
 * @return The buildable object.
 */
@Deprecated public List getEphemeralContainerStatuses() {
        return build(ephemeralContainerStatuses);
    }

    public List buildEphemeralContainerStatuses() {
        return build(ephemeralContainerStatuses);
    }

    public V1ContainerStatus buildEphemeralContainerStatus(int index) {
        return this.ephemeralContainerStatuses.get(index).build();
    }

    public V1ContainerStatus buildFirstEphemeralContainerStatus() {
        return this.ephemeralContainerStatuses.get(0).build();
    }

    public V1ContainerStatus buildLastEphemeralContainerStatus() {
        return this.ephemeralContainerStatuses.get(ephemeralContainerStatuses.size() - 1).build();
    }

    public V1ContainerStatus buildMatchingEphemeralContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: ephemeralContainerStatuses) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingEphemeralContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: ephemeralContainerStatuses) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withEphemeralContainerStatuses(List ephemeralContainerStatuses) {
        if (this.ephemeralContainerStatuses != null) { _visitables.get("ephemeralContainerStatuses").removeAll(this.ephemeralContainerStatuses);}
        if (ephemeralContainerStatuses != null) {this.ephemeralContainerStatuses = new ArrayList(); for (V1ContainerStatus item : ephemeralContainerStatuses){this.addToEphemeralContainerStatuses(item);}} else { this.ephemeralContainerStatuses = null;} return (A) this;
    }

    public A withEphemeralContainerStatuses(V1ContainerStatus... ephemeralContainerStatuses) {
        if (this.ephemeralContainerStatuses != null) {this.ephemeralContainerStatuses.clear();}
        if (ephemeralContainerStatuses != null) {for (V1ContainerStatus item :ephemeralContainerStatuses){ this.addToEphemeralContainerStatuses(item);}} return (A) this;
    }

    public Boolean hasEphemeralContainerStatuses() {
        return ephemeralContainerStatuses != null && !ephemeralContainerStatuses.isEmpty();
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested addNewEphemeralContainerStatus() {
        return new EphemeralContainerStatusesNestedImpl();
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested addNewEphemeralContainerStatusLike(V1ContainerStatus item) {
        return new EphemeralContainerStatusesNestedImpl(-1, item);
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested setNewEphemeralContainerStatusLike(int index,V1ContainerStatus item) {
        return new EphemeralContainerStatusesNestedImpl(index, item);
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested editEphemeralContainerStatus(int index) {
        if (ephemeralContainerStatuses.size() <= index) throw new RuntimeException("Can't edit ephemeralContainerStatuses. Index exceeds size.");
        return setNewEphemeralContainerStatusLike(index, buildEphemeralContainerStatus(index));
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested editFirstEphemeralContainerStatus() {
        if (ephemeralContainerStatuses.size() == 0) throw new RuntimeException("Can't edit first ephemeralContainerStatuses. The list is empty.");
        return setNewEphemeralContainerStatusLike(0, buildEphemeralContainerStatus(0));
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested editLastEphemeralContainerStatus() {
        int index = ephemeralContainerStatuses.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last ephemeralContainerStatuses. The list is empty.");
        return setNewEphemeralContainerStatusLike(index, buildEphemeralContainerStatus(index));
    }

    public V1PodStatusFluent.EphemeralContainerStatusesNested editMatchingEphemeralContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("initContainerStatuses").add(index >= 0 ? index : _visitables.get("initContainerStatuses").size(), builder);this.initContainerStatuses.add(index >= 0 ? index : initContainerStatuses.size(), builder); return (A)this;
    }

    public A setToInitContainerStatuses(int index,V1ContainerStatus item) {
        if (this.initContainerStatuses == null) {this.initContainerStatuses = new ArrayList();}
        V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);
        if (index < 0 || index >= _visitables.get("initContainerStatuses").size()) { _visitables.get("initContainerStatuses").add(builder); } else { _visitables.get("initContainerStatuses").set(index, builder);}
        if (index < 0 || index >= initContainerStatuses.size()) { initContainerStatuses.add(builder); } else { initContainerStatuses.set(index, builder);}
         return (A)this;
    }

    public A addToInitContainerStatuses(V1ContainerStatus... items) {
        if (this.initContainerStatuses == null) {this.initContainerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("initContainerStatuses").add(builder);this.initContainerStatuses.add(builder);} return (A)this;
    }

    public A addAllToInitContainerStatuses(Collection items) {
        if (this.initContainerStatuses == null) {this.initContainerStatuses = new ArrayList();}
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("initContainerStatuses").add(builder);this.initContainerStatuses.add(builder);} return (A)this;
    }

    public A removeFromInitContainerStatuses(V1ContainerStatus... items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("initContainerStatuses").remove(builder);if (this.initContainerStatuses != null) {this.initContainerStatuses.remove(builder);}} return (A)this;
    }

    public A removeAllFromInitContainerStatuses(Collection items) {
        for (V1ContainerStatus item : items) {V1ContainerStatusBuilder builder = new V1ContainerStatusBuilder(item);_visitables.get("initContainerStatuses").remove(builder);if (this.initContainerStatuses != null) {this.initContainerStatuses.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromInitContainerStatuses(io.kubernetes.client.fluent.Predicate predicate) {
        if (initContainerStatuses == null) return (A) this;
        final Iterator each = initContainerStatuses.iterator();
        final List visitables = _visitables.get("initContainerStatuses");
        while (each.hasNext()) {
          V1ContainerStatusBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildInitContainerStatuses instead.
 * @return The buildable object.
 */
@Deprecated public List getInitContainerStatuses() {
        return build(initContainerStatuses);
    }

    public List buildInitContainerStatuses() {
        return build(initContainerStatuses);
    }

    public V1ContainerStatus buildInitContainerStatus(int index) {
        return this.initContainerStatuses.get(index).build();
    }

    public V1ContainerStatus buildFirstInitContainerStatus() {
        return this.initContainerStatuses.get(0).build();
    }

    public V1ContainerStatus buildLastInitContainerStatus() {
        return this.initContainerStatuses.get(initContainerStatuses.size() - 1).build();
    }

    public V1ContainerStatus buildMatchingInitContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: initContainerStatuses) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingInitContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1ContainerStatusBuilder item: initContainerStatuses) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withInitContainerStatuses(List initContainerStatuses) {
        if (this.initContainerStatuses != null) { _visitables.get("initContainerStatuses").removeAll(this.initContainerStatuses);}
        if (initContainerStatuses != null) {this.initContainerStatuses = new ArrayList(); for (V1ContainerStatus item : initContainerStatuses){this.addToInitContainerStatuses(item);}} else { this.initContainerStatuses = null;} return (A) this;
    }

    public A withInitContainerStatuses(V1ContainerStatus... initContainerStatuses) {
        if (this.initContainerStatuses != null) {this.initContainerStatuses.clear();}
        if (initContainerStatuses != null) {for (V1ContainerStatus item :initContainerStatuses){ this.addToInitContainerStatuses(item);}} return (A) this;
    }

    public Boolean hasInitContainerStatuses() {
        return initContainerStatuses != null && !initContainerStatuses.isEmpty();
    }

    public V1PodStatusFluent.InitContainerStatusesNested addNewInitContainerStatus() {
        return new InitContainerStatusesNestedImpl();
    }

    public V1PodStatusFluent.InitContainerStatusesNested addNewInitContainerStatusLike(V1ContainerStatus item) {
        return new InitContainerStatusesNestedImpl(-1, item);
    }

    public V1PodStatusFluent.InitContainerStatusesNested setNewInitContainerStatusLike(int index,V1ContainerStatus item) {
        return new InitContainerStatusesNestedImpl(index, item);
    }

    public V1PodStatusFluent.InitContainerStatusesNested editInitContainerStatus(int index) {
        if (initContainerStatuses.size() <= index) throw new RuntimeException("Can't edit initContainerStatuses. Index exceeds size.");
        return setNewInitContainerStatusLike(index, buildInitContainerStatus(index));
    }

    public V1PodStatusFluent.InitContainerStatusesNested editFirstInitContainerStatus() {
        if (initContainerStatuses.size() == 0) throw new RuntimeException("Can't edit first initContainerStatuses. The list is empty.");
        return setNewInitContainerStatusLike(0, buildInitContainerStatus(0));
    }

    public V1PodStatusFluent.InitContainerStatusesNested editLastInitContainerStatus() {
        int index = initContainerStatuses.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last initContainerStatuses. The list is empty.");
        return setNewInitContainerStatusLike(index, buildInitContainerStatus(index));
    }

    public V1PodStatusFluent.InitContainerStatusesNested editMatchingInitContainerStatus(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i();}
        V1PodIPBuilder builder = new V1PodIPBuilder(item);_visitables.get("podIPs").add(index >= 0 ? index : _visitables.get("podIPs").size(), builder);this.podIPs.add(index >= 0 ? index : podIPs.size(), builder); return (A)this;
    }

    public A setToPodIPs(int index,V1PodIP item) {
        if (this.podIPs == null) {this.podIPs = new ArrayList();}
        V1PodIPBuilder builder = new V1PodIPBuilder(item);
        if (index < 0 || index >= _visitables.get("podIPs").size()) { _visitables.get("podIPs").add(builder); } else { _visitables.get("podIPs").set(index, builder);}
        if (index < 0 || index >= podIPs.size()) { podIPs.add(builder); } else { podIPs.set(index, builder);}
         return (A)this;
    }

    public A addToPodIPs(V1PodIP... items) {
        if (this.podIPs == null) {this.podIPs = new ArrayList();}
        for (V1PodIP item : items) {V1PodIPBuilder builder = new V1PodIPBuilder(item);_visitables.get("podIPs").add(builder);this.podIPs.add(builder);} return (A)this;
    }

    public A addAllToPodIPs(Collection items) {
        if (this.podIPs == null) {this.podIPs = new ArrayList();}
        for (V1PodIP item : items) {V1PodIPBuilder builder = new V1PodIPBuilder(item);_visitables.get("podIPs").add(builder);this.podIPs.add(builder);} return (A)this;
    }

    public A removeFromPodIPs(V1PodIP... items) {
        for (V1PodIP item : items) {V1PodIPBuilder builder = new V1PodIPBuilder(item);_visitables.get("podIPs").remove(builder);if (this.podIPs != null) {this.podIPs.remove(builder);}} return (A)this;
    }

    public A removeAllFromPodIPs(Collection items) {
        for (V1PodIP item : items) {V1PodIPBuilder builder = new V1PodIPBuilder(item);_visitables.get("podIPs").remove(builder);if (this.podIPs != null) {this.podIPs.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromPodIPs(io.kubernetes.client.fluent.Predicate predicate) {
        if (podIPs == null) return (A) this;
        final Iterator each = podIPs.iterator();
        final List visitables = _visitables.get("podIPs");
        while (each.hasNext()) {
          V1PodIPBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildPodIPs instead.
 * @return The buildable object.
 */
@Deprecated public List getPodIPs() {
        return build(podIPs);
    }

    public List buildPodIPs() {
        return build(podIPs);
    }

    public V1PodIP buildPodIP(int index) {
        return this.podIPs.get(index).build();
    }

    public V1PodIP buildFirstPodIP() {
        return this.podIPs.get(0).build();
    }

    public V1PodIP buildLastPodIP() {
        return this.podIPs.get(podIPs.size() - 1).build();
    }

    public V1PodIP buildMatchingPodIP(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1PodIPBuilder item: podIPs) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingPodIP(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1PodIPBuilder item: podIPs) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withPodIPs(List podIPs) {
        if (this.podIPs != null) { _visitables.get("podIPs").removeAll(this.podIPs);}
        if (podIPs != null) {this.podIPs = new ArrayList(); for (V1PodIP item : podIPs){this.addToPodIPs(item);}} else { this.podIPs = null;} return (A) this;
    }

    public A withPodIPs(V1PodIP... podIPs) {
        if (this.podIPs != null) {this.podIPs.clear();}
        if (podIPs != null) {for (V1PodIP item :podIPs){ this.addToPodIPs(item);}} return (A) this;
    }

    public Boolean hasPodIPs() {
        return podIPs != null && !podIPs.isEmpty();
    }

    public V1PodStatusFluent.PodIPsNested addNewPodIP() {
        return new PodIPsNestedImpl();
    }

    public V1PodStatusFluent.PodIPsNested addNewPodIPLike(V1PodIP item) {
        return new PodIPsNestedImpl(-1, item);
    }

    public V1PodStatusFluent.PodIPsNested setNewPodIPLike(int index,V1PodIP item) {
        return new PodIPsNestedImpl(index, item);
    }

    public V1PodStatusFluent.PodIPsNested editPodIP(int index) {
        if (podIPs.size() <= index) throw new RuntimeException("Can't edit podIPs. Index exceeds size.");
        return setNewPodIPLike(index, buildPodIP(index));
    }

    public V1PodStatusFluent.PodIPsNested editFirstPodIP() {
        if (podIPs.size() == 0) throw new RuntimeException("Can't edit first podIPs. The list is empty.");
        return setNewPodIPLike(0, buildPodIP(0));
    }

    public V1PodStatusFluent.PodIPsNested editLastPodIP() {
        int index = podIPs.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last podIPs. The list is empty.");
        return setNewPodIPLike(index, buildPodIP(index));
    }

    public V1PodStatusFluent.PodIPsNested editMatchingPodIP(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i extends V1PodConditionFluentImpl> implements V1PodStatusFluent.ConditionsNested,io.kubernetes.client.fluent.Nested {
        private final V1PodConditionBuilder builder;
        private final int index;

        ConditionsNestedImpl(int index,V1PodCondition item) {
            this.index = index;
            this.builder = new V1PodConditionBuilder(this, item);
        }

        ConditionsNestedImpl() {
            this.index = -1;
            this.builder = new V1PodConditionBuilder(this);
        }

        public N and() {
             return (N) V1PodStatusFluentImpl.this.setToConditions(index,builder.build());
        }

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


    public class ContainerStatusesNestedImpl extends V1ContainerStatusFluentImpl> implements V1PodStatusFluent.ContainerStatusesNested,io.kubernetes.client.fluent.Nested {
        private final V1ContainerStatusBuilder builder;
        private final int index;

        ContainerStatusesNestedImpl(int index,V1ContainerStatus item) {
            this.index = index;
            this.builder = new V1ContainerStatusBuilder(this, item);
        }

        ContainerStatusesNestedImpl() {
            this.index = -1;
            this.builder = new V1ContainerStatusBuilder(this);
        }

        public N and() {
             return (N) V1PodStatusFluentImpl.this.setToContainerStatuses(index,builder.build());
        }

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


    public class EphemeralContainerStatusesNestedImpl extends V1ContainerStatusFluentImpl> implements V1PodStatusFluent.EphemeralContainerStatusesNested,io.kubernetes.client.fluent.Nested {
        private final V1ContainerStatusBuilder builder;
        private final int index;

        EphemeralContainerStatusesNestedImpl(int index,V1ContainerStatus item) {
            this.index = index;
            this.builder = new V1ContainerStatusBuilder(this, item);
        }

        EphemeralContainerStatusesNestedImpl() {
            this.index = -1;
            this.builder = new V1ContainerStatusBuilder(this);
        }

        public N and() {
             return (N) V1PodStatusFluentImpl.this.setToEphemeralContainerStatuses(index,builder.build());
        }

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


    public class InitContainerStatusesNestedImpl extends V1ContainerStatusFluentImpl> implements V1PodStatusFluent.InitContainerStatusesNested,io.kubernetes.client.fluent.Nested {
        private final V1ContainerStatusBuilder builder;
        private final int index;

        InitContainerStatusesNestedImpl(int index,V1ContainerStatus item) {
            this.index = index;
            this.builder = new V1ContainerStatusBuilder(this, item);
        }

        InitContainerStatusesNestedImpl() {
            this.index = -1;
            this.builder = new V1ContainerStatusBuilder(this);
        }

        public N and() {
             return (N) V1PodStatusFluentImpl.this.setToInitContainerStatuses(index,builder.build());
        }

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


    public class PodIPsNestedImpl extends V1PodIPFluentImpl> implements V1PodStatusFluent.PodIPsNested,io.kubernetes.client.fluent.Nested {
        private final V1PodIPBuilder builder;
        private final int index;

        PodIPsNestedImpl(int index,V1PodIP item) {
            this.index = index;
            this.builder = new V1PodIPBuilder(this, item);
        }

        PodIPsNestedImpl() {
            this.index = -1;
            this.builder = new V1PodIPBuilder(this);
        }

        public N and() {
             return (N) V1PodStatusFluentImpl.this.setToPodIPs(index,builder.build());
        }

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


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy