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

io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.RAIDConfigFluent Maven / Gradle / Ivy

There is a newer version: 6.13.4
Show newest version
package io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1;

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.util.Collection;
import java.lang.Object;
import java.util.Map;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class RAIDConfigFluent> extends BaseFluent{
  public RAIDConfigFluent() {
  }
  
  public RAIDConfigFluent(RAIDConfig instance) {
    this.copyInstance(instance);
  }
  private ArrayList hardwareRAIDVolumes = new ArrayList();
  private ArrayList softwareRAIDVolumes = new ArrayList();
  private Map additionalProperties;
  
  protected void copyInstance(RAIDConfig instance) {
    instance = (instance != null ? instance : new RAIDConfig());
    if (instance != null) {
          this.withHardwareRAIDVolumes(instance.getHardwareRAIDVolumes());
          this.withSoftwareRAIDVolumes(instance.getSoftwareRAIDVolumes());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public A addToHardwareRAIDVolumes(int index,HardwareRAIDVolume item) {
    if (this.hardwareRAIDVolumes == null) {this.hardwareRAIDVolumes = new ArrayList();}
    HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);
    if (index < 0 || index >= hardwareRAIDVolumes.size()) { _visitables.get("hardwareRAIDVolumes").add(builder); hardwareRAIDVolumes.add(builder); } else { _visitables.get("hardwareRAIDVolumes").add(index, builder); hardwareRAIDVolumes.add(index, builder);}
    return (A)this;
  }
  
  public A setToHardwareRAIDVolumes(int index,HardwareRAIDVolume item) {
    if (this.hardwareRAIDVolumes == null) {this.hardwareRAIDVolumes = new ArrayList();}
    HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);
    if (index < 0 || index >= hardwareRAIDVolumes.size()) { _visitables.get("hardwareRAIDVolumes").add(builder); hardwareRAIDVolumes.add(builder); } else { _visitables.get("hardwareRAIDVolumes").set(index, builder); hardwareRAIDVolumes.set(index, builder);}
    return (A)this;
  }
  
  public A addToHardwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.HardwareRAIDVolume... items) {
    if (this.hardwareRAIDVolumes == null) {this.hardwareRAIDVolumes = new ArrayList();}
    for (HardwareRAIDVolume item : items) {HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);_visitables.get("hardwareRAIDVolumes").add(builder);this.hardwareRAIDVolumes.add(builder);} return (A)this;
  }
  
  public A addAllToHardwareRAIDVolumes(Collection items) {
    if (this.hardwareRAIDVolumes == null) {this.hardwareRAIDVolumes = new ArrayList();}
    for (HardwareRAIDVolume item : items) {HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);_visitables.get("hardwareRAIDVolumes").add(builder);this.hardwareRAIDVolumes.add(builder);} return (A)this;
  }
  
  public A removeFromHardwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.HardwareRAIDVolume... items) {
    if (this.hardwareRAIDVolumes == null) return (A)this;
    for (HardwareRAIDVolume item : items) {HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);_visitables.get("hardwareRAIDVolumes").remove(builder); this.hardwareRAIDVolumes.remove(builder);} return (A)this;
  }
  
  public A removeAllFromHardwareRAIDVolumes(Collection items) {
    if (this.hardwareRAIDVolumes == null) return (A)this;
    for (HardwareRAIDVolume item : items) {HardwareRAIDVolumeBuilder builder = new HardwareRAIDVolumeBuilder(item);_visitables.get("hardwareRAIDVolumes").remove(builder); this.hardwareRAIDVolumes.remove(builder);} return (A)this;
  }
  
  public A removeMatchingFromHardwareRAIDVolumes(Predicate predicate) {
    if (hardwareRAIDVolumes == null) return (A) this;
    final Iterator each = hardwareRAIDVolumes.iterator();
    final List visitables = _visitables.get("hardwareRAIDVolumes");
    while (each.hasNext()) {
      HardwareRAIDVolumeBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  public List buildHardwareRAIDVolumes() {
    return this.hardwareRAIDVolumes != null ? build(hardwareRAIDVolumes) : null;
  }
  
  public HardwareRAIDVolume buildHardwareRAIDVolume(int index) {
    return this.hardwareRAIDVolumes.get(index).build();
  }
  
  public HardwareRAIDVolume buildFirstHardwareRAIDVolume() {
    return this.hardwareRAIDVolumes.get(0).build();
  }
  
  public HardwareRAIDVolume buildLastHardwareRAIDVolume() {
    return this.hardwareRAIDVolumes.get(hardwareRAIDVolumes.size() - 1).build();
  }
  
  public HardwareRAIDVolume buildMatchingHardwareRAIDVolume(Predicate predicate) {
      for (HardwareRAIDVolumeBuilder item : hardwareRAIDVolumes) {
        if (predicate.test(item)) {
          return item.build();
        }
      }
      return null;
  }
  
  public boolean hasMatchingHardwareRAIDVolume(Predicate predicate) {
      for (HardwareRAIDVolumeBuilder item : hardwareRAIDVolumes) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withHardwareRAIDVolumes(List hardwareRAIDVolumes) {
    if (this.hardwareRAIDVolumes != null) {
      this._visitables.get("hardwareRAIDVolumes").clear();
    }
    if (hardwareRAIDVolumes != null) {
        this.hardwareRAIDVolumes = new ArrayList();
        for (HardwareRAIDVolume item : hardwareRAIDVolumes) {
          this.addToHardwareRAIDVolumes(item);
        }
    } else {
      this.hardwareRAIDVolumes = null;
    }
    return (A) this;
  }
  
  public A withHardwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.HardwareRAIDVolume... hardwareRAIDVolumes) {
    if (this.hardwareRAIDVolumes != null) {
        this.hardwareRAIDVolumes.clear();
        _visitables.remove("hardwareRAIDVolumes");
    }
    if (hardwareRAIDVolumes != null) {
      for (HardwareRAIDVolume item : hardwareRAIDVolumes) {
        this.addToHardwareRAIDVolumes(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasHardwareRAIDVolumes() {
    return this.hardwareRAIDVolumes != null && !this.hardwareRAIDVolumes.isEmpty();
  }
  
  public HardwareRAIDVolumesNested addNewHardwareRAIDVolume() {
    return new HardwareRAIDVolumesNested(-1, null);
  }
  
  public HardwareRAIDVolumesNested addNewHardwareRAIDVolumeLike(HardwareRAIDVolume item) {
    return new HardwareRAIDVolumesNested(-1, item);
  }
  
  public HardwareRAIDVolumesNested setNewHardwareRAIDVolumeLike(int index,HardwareRAIDVolume item) {
    return new HardwareRAIDVolumesNested(index, item);
  }
  
  public HardwareRAIDVolumesNested editHardwareRAIDVolume(int index) {
    if (hardwareRAIDVolumes.size() <= index) throw new RuntimeException("Can't edit hardwareRAIDVolumes. Index exceeds size.");
    return setNewHardwareRAIDVolumeLike(index, buildHardwareRAIDVolume(index));
  }
  
  public HardwareRAIDVolumesNested editFirstHardwareRAIDVolume() {
    if (hardwareRAIDVolumes.size() == 0) throw new RuntimeException("Can't edit first hardwareRAIDVolumes. The list is empty.");
    return setNewHardwareRAIDVolumeLike(0, buildHardwareRAIDVolume(0));
  }
  
  public HardwareRAIDVolumesNested editLastHardwareRAIDVolume() {
    int index = hardwareRAIDVolumes.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last hardwareRAIDVolumes. The list is empty.");
    return setNewHardwareRAIDVolumeLike(index, buildHardwareRAIDVolume(index));
  }
  
  public HardwareRAIDVolumesNested editMatchingHardwareRAIDVolume(Predicate predicate) {
    int index = -1;
    for (int i=0;i();}
    SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);
    if (index < 0 || index >= softwareRAIDVolumes.size()) { _visitables.get("softwareRAIDVolumes").add(builder); softwareRAIDVolumes.add(builder); } else { _visitables.get("softwareRAIDVolumes").add(index, builder); softwareRAIDVolumes.add(index, builder);}
    return (A)this;
  }
  
  public A setToSoftwareRAIDVolumes(int index,SoftwareRAIDVolume item) {
    if (this.softwareRAIDVolumes == null) {this.softwareRAIDVolumes = new ArrayList();}
    SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);
    if (index < 0 || index >= softwareRAIDVolumes.size()) { _visitables.get("softwareRAIDVolumes").add(builder); softwareRAIDVolumes.add(builder); } else { _visitables.get("softwareRAIDVolumes").set(index, builder); softwareRAIDVolumes.set(index, builder);}
    return (A)this;
  }
  
  public A addToSoftwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.SoftwareRAIDVolume... items) {
    if (this.softwareRAIDVolumes == null) {this.softwareRAIDVolumes = new ArrayList();}
    for (SoftwareRAIDVolume item : items) {SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);_visitables.get("softwareRAIDVolumes").add(builder);this.softwareRAIDVolumes.add(builder);} return (A)this;
  }
  
  public A addAllToSoftwareRAIDVolumes(Collection items) {
    if (this.softwareRAIDVolumes == null) {this.softwareRAIDVolumes = new ArrayList();}
    for (SoftwareRAIDVolume item : items) {SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);_visitables.get("softwareRAIDVolumes").add(builder);this.softwareRAIDVolumes.add(builder);} return (A)this;
  }
  
  public A removeFromSoftwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.SoftwareRAIDVolume... items) {
    if (this.softwareRAIDVolumes == null) return (A)this;
    for (SoftwareRAIDVolume item : items) {SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);_visitables.get("softwareRAIDVolumes").remove(builder); this.softwareRAIDVolumes.remove(builder);} return (A)this;
  }
  
  public A removeAllFromSoftwareRAIDVolumes(Collection items) {
    if (this.softwareRAIDVolumes == null) return (A)this;
    for (SoftwareRAIDVolume item : items) {SoftwareRAIDVolumeBuilder builder = new SoftwareRAIDVolumeBuilder(item);_visitables.get("softwareRAIDVolumes").remove(builder); this.softwareRAIDVolumes.remove(builder);} return (A)this;
  }
  
  public A removeMatchingFromSoftwareRAIDVolumes(Predicate predicate) {
    if (softwareRAIDVolumes == null) return (A) this;
    final Iterator each = softwareRAIDVolumes.iterator();
    final List visitables = _visitables.get("softwareRAIDVolumes");
    while (each.hasNext()) {
      SoftwareRAIDVolumeBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  public List buildSoftwareRAIDVolumes() {
    return this.softwareRAIDVolumes != null ? build(softwareRAIDVolumes) : null;
  }
  
  public SoftwareRAIDVolume buildSoftwareRAIDVolume(int index) {
    return this.softwareRAIDVolumes.get(index).build();
  }
  
  public SoftwareRAIDVolume buildFirstSoftwareRAIDVolume() {
    return this.softwareRAIDVolumes.get(0).build();
  }
  
  public SoftwareRAIDVolume buildLastSoftwareRAIDVolume() {
    return this.softwareRAIDVolumes.get(softwareRAIDVolumes.size() - 1).build();
  }
  
  public SoftwareRAIDVolume buildMatchingSoftwareRAIDVolume(Predicate predicate) {
      for (SoftwareRAIDVolumeBuilder item : softwareRAIDVolumes) {
        if (predicate.test(item)) {
          return item.build();
        }
      }
      return null;
  }
  
  public boolean hasMatchingSoftwareRAIDVolume(Predicate predicate) {
      for (SoftwareRAIDVolumeBuilder item : softwareRAIDVolumes) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withSoftwareRAIDVolumes(List softwareRAIDVolumes) {
    if (this.softwareRAIDVolumes != null) {
      this._visitables.get("softwareRAIDVolumes").clear();
    }
    if (softwareRAIDVolumes != null) {
        this.softwareRAIDVolumes = new ArrayList();
        for (SoftwareRAIDVolume item : softwareRAIDVolumes) {
          this.addToSoftwareRAIDVolumes(item);
        }
    } else {
      this.softwareRAIDVolumes = null;
    }
    return (A) this;
  }
  
  public A withSoftwareRAIDVolumes(io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.SoftwareRAIDVolume... softwareRAIDVolumes) {
    if (this.softwareRAIDVolumes != null) {
        this.softwareRAIDVolumes.clear();
        _visitables.remove("softwareRAIDVolumes");
    }
    if (softwareRAIDVolumes != null) {
      for (SoftwareRAIDVolume item : softwareRAIDVolumes) {
        this.addToSoftwareRAIDVolumes(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasSoftwareRAIDVolumes() {
    return this.softwareRAIDVolumes != null && !this.softwareRAIDVolumes.isEmpty();
  }
  
  public SoftwareRAIDVolumesNested addNewSoftwareRAIDVolume() {
    return new SoftwareRAIDVolumesNested(-1, null);
  }
  
  public SoftwareRAIDVolumesNested addNewSoftwareRAIDVolumeLike(SoftwareRAIDVolume item) {
    return new SoftwareRAIDVolumesNested(-1, item);
  }
  
  public SoftwareRAIDVolumesNested setNewSoftwareRAIDVolumeLike(int index,SoftwareRAIDVolume item) {
    return new SoftwareRAIDVolumesNested(index, item);
  }
  
  public SoftwareRAIDVolumesNested editSoftwareRAIDVolume(int index) {
    if (softwareRAIDVolumes.size() <= index) throw new RuntimeException("Can't edit softwareRAIDVolumes. Index exceeds size.");
    return setNewSoftwareRAIDVolumeLike(index, buildSoftwareRAIDVolume(index));
  }
  
  public SoftwareRAIDVolumesNested editFirstSoftwareRAIDVolume() {
    if (softwareRAIDVolumes.size() == 0) throw new RuntimeException("Can't edit first softwareRAIDVolumes. The list is empty.");
    return setNewSoftwareRAIDVolumeLike(0, buildSoftwareRAIDVolume(0));
  }
  
  public SoftwareRAIDVolumesNested editLastSoftwareRAIDVolume() {
    int index = softwareRAIDVolumes.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last softwareRAIDVolumes. The list is empty.");
    return setNewSoftwareRAIDVolumeLike(index, buildSoftwareRAIDVolume(index));
  }
  
  public SoftwareRAIDVolumesNested editMatchingSoftwareRAIDVolume(Predicate predicate) {
    int index = -1;
    for (int i=0;i map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  
  public Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  
  public A withAdditionalProperties(Map additionalProperties) {
    if (additionalProperties == null) {
      this.additionalProperties = null;
    } else {
      this.additionalProperties = new LinkedHashMap(additionalProperties);
    }
    return (A) this;
  }
  
  public boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    RAIDConfigFluent that = (RAIDConfigFluent) o;
    if (!java.util.Objects.equals(hardwareRAIDVolumes, that.hardwareRAIDVolumes)) return false;
    if (!java.util.Objects.equals(softwareRAIDVolumes, that.softwareRAIDVolumes)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(hardwareRAIDVolumes,  softwareRAIDVolumes,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (hardwareRAIDVolumes != null && !hardwareRAIDVolumes.isEmpty()) { sb.append("hardwareRAIDVolumes:"); sb.append(hardwareRAIDVolumes + ","); }
    if (softwareRAIDVolumes != null && !softwareRAIDVolumes.isEmpty()) { sb.append("softwareRAIDVolumes:"); sb.append(softwareRAIDVolumes + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class HardwareRAIDVolumesNested extends HardwareRAIDVolumeFluent> implements Nested{
    HardwareRAIDVolumesNested(int index,HardwareRAIDVolume item) {
      this.index = index;
      this.builder = new HardwareRAIDVolumeBuilder(this, item);
    }
    HardwareRAIDVolumeBuilder builder;
    int index;
    
    public N and() {
      return (N) RAIDConfigFluent.this.setToHardwareRAIDVolumes(index,builder.build());
    }
    
    public N endHardwareRAIDVolume() {
      return and();
    }
    
  
  }
  public class SoftwareRAIDVolumesNested extends SoftwareRAIDVolumeFluent> implements Nested{
    SoftwareRAIDVolumesNested(int index,SoftwareRAIDVolume item) {
      this.index = index;
      this.builder = new SoftwareRAIDVolumeBuilder(this, item);
    }
    SoftwareRAIDVolumeBuilder builder;
    int index;
    
    public N and() {
      return (N) RAIDConfigFluent.this.setToSoftwareRAIDVolumes(index,builder.build());
    }
    
    public N endSoftwareRAIDVolume() {
      return and();
    }
    
  
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy