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

io.fabric8.openshift.api.model.installer.v1.InstallConfigFluent Maven / Gradle / Ivy

The newest version!
package io.fabric8.openshift.api.model.installer.v1;

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

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class InstallConfigFluent> extends BaseFluent{
  public InstallConfigFluent() {
  }
  
  public InstallConfigFluent(InstallConfig instance) {
    this.copyInstance(instance);
  }
  private String additionalTrustBundle;
  private String additionalTrustBundlePolicy;
  private String apiVersion;
  private String baseDomain;
  private BootstrapInPlaceBuilder bootstrapInPlace;
  private CapabilitiesBuilder capabilities;
  private ArrayList compute = new ArrayList();
  private MachinePoolBuilder controlPlane;
  private String cpuPartitioningMode;
  private String credentialsMode;
  private List featureGates = new ArrayList();
  private String featureSet;
  private Boolean fips;
  private ArrayList imageContentSources = new ArrayList();
  private ArrayList imageDigestSources = new ArrayList();
  private String kind;
  private ObjectMetaBuilder metadata;
  private NetworkingBuilder networking;
  private OperatorPublishingStrategyBuilder operatorPublishingStrategy;
  private PlatformBuilder platform;
  private ProxyBuilder proxy;
  private String publish;
  private String pullSecret;
  private String sshKey;
  private Map additionalProperties;
  
  protected void copyInstance(InstallConfig instance) {
    instance = (instance != null ? instance : new InstallConfig());
    if (instance != null) {
          this.withAdditionalTrustBundle(instance.getAdditionalTrustBundle());
          this.withAdditionalTrustBundlePolicy(instance.getAdditionalTrustBundlePolicy());
          this.withApiVersion(instance.getApiVersion());
          this.withBaseDomain(instance.getBaseDomain());
          this.withBootstrapInPlace(instance.getBootstrapInPlace());
          this.withCapabilities(instance.getCapabilities());
          this.withCompute(instance.getCompute());
          this.withControlPlane(instance.getControlPlane());
          this.withCpuPartitioningMode(instance.getCpuPartitioningMode());
          this.withCredentialsMode(instance.getCredentialsMode());
          this.withFeatureGates(instance.getFeatureGates());
          this.withFeatureSet(instance.getFeatureSet());
          this.withFips(instance.getFips());
          this.withImageContentSources(instance.getImageContentSources());
          this.withImageDigestSources(instance.getImageDigestSources());
          this.withKind(instance.getKind());
          this.withMetadata(instance.getMetadata());
          this.withNetworking(instance.getNetworking());
          this.withOperatorPublishingStrategy(instance.getOperatorPublishingStrategy());
          this.withPlatform(instance.getPlatform());
          this.withProxy(instance.getProxy());
          this.withPublish(instance.getPublish());
          this.withPullSecret(instance.getPullSecret());
          this.withSshKey(instance.getSshKey());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public String getAdditionalTrustBundle() {
    return this.additionalTrustBundle;
  }
  
  public A withAdditionalTrustBundle(String additionalTrustBundle) {
    this.additionalTrustBundle = additionalTrustBundle;
    return (A) this;
  }
  
  public boolean hasAdditionalTrustBundle() {
    return this.additionalTrustBundle != null;
  }
  
  public String getAdditionalTrustBundlePolicy() {
    return this.additionalTrustBundlePolicy;
  }
  
  public A withAdditionalTrustBundlePolicy(String additionalTrustBundlePolicy) {
    this.additionalTrustBundlePolicy = additionalTrustBundlePolicy;
    return (A) this;
  }
  
  public boolean hasAdditionalTrustBundlePolicy() {
    return this.additionalTrustBundlePolicy != null;
  }
  
  public String getApiVersion() {
    return this.apiVersion;
  }
  
  public A withApiVersion(String apiVersion) {
    this.apiVersion = apiVersion;
    return (A) this;
  }
  
  public boolean hasApiVersion() {
    return this.apiVersion != null;
  }
  
  public String getBaseDomain() {
    return this.baseDomain;
  }
  
  public A withBaseDomain(String baseDomain) {
    this.baseDomain = baseDomain;
    return (A) this;
  }
  
  public boolean hasBaseDomain() {
    return this.baseDomain != null;
  }
  
  public BootstrapInPlace buildBootstrapInPlace() {
    return this.bootstrapInPlace != null ? this.bootstrapInPlace.build() : null;
  }
  
  public A withBootstrapInPlace(BootstrapInPlace bootstrapInPlace) {
    this._visitables.remove("bootstrapInPlace");
    if (bootstrapInPlace != null) {
        this.bootstrapInPlace = new BootstrapInPlaceBuilder(bootstrapInPlace);
        this._visitables.get("bootstrapInPlace").add(this.bootstrapInPlace);
    } else {
        this.bootstrapInPlace = null;
        this._visitables.get("bootstrapInPlace").remove(this.bootstrapInPlace);
    }
    return (A) this;
  }
  
  public boolean hasBootstrapInPlace() {
    return this.bootstrapInPlace != null;
  }
  
  public A withNewBootstrapInPlace(String installationDisk) {
    return (A)withBootstrapInPlace(new BootstrapInPlace(installationDisk));
  }
  
  public BootstrapInPlaceNested withNewBootstrapInPlace() {
    return new BootstrapInPlaceNested(null);
  }
  
  public BootstrapInPlaceNested withNewBootstrapInPlaceLike(BootstrapInPlace item) {
    return new BootstrapInPlaceNested(item);
  }
  
  public BootstrapInPlaceNested editBootstrapInPlace() {
    return withNewBootstrapInPlaceLike(java.util.Optional.ofNullable(buildBootstrapInPlace()).orElse(null));
  }
  
  public BootstrapInPlaceNested editOrNewBootstrapInPlace() {
    return withNewBootstrapInPlaceLike(java.util.Optional.ofNullable(buildBootstrapInPlace()).orElse(new BootstrapInPlaceBuilder().build()));
  }
  
  public BootstrapInPlaceNested editOrNewBootstrapInPlaceLike(BootstrapInPlace item) {
    return withNewBootstrapInPlaceLike(java.util.Optional.ofNullable(buildBootstrapInPlace()).orElse(item));
  }
  
  public Capabilities buildCapabilities() {
    return this.capabilities != null ? this.capabilities.build() : null;
  }
  
  public A withCapabilities(Capabilities capabilities) {
    this._visitables.remove("capabilities");
    if (capabilities != null) {
        this.capabilities = new CapabilitiesBuilder(capabilities);
        this._visitables.get("capabilities").add(this.capabilities);
    } else {
        this.capabilities = null;
        this._visitables.get("capabilities").remove(this.capabilities);
    }
    return (A) this;
  }
  
  public boolean hasCapabilities() {
    return this.capabilities != null;
  }
  
  public CapabilitiesNested withNewCapabilities() {
    return new CapabilitiesNested(null);
  }
  
  public CapabilitiesNested withNewCapabilitiesLike(Capabilities item) {
    return new CapabilitiesNested(item);
  }
  
  public CapabilitiesNested editCapabilities() {
    return withNewCapabilitiesLike(java.util.Optional.ofNullable(buildCapabilities()).orElse(null));
  }
  
  public CapabilitiesNested editOrNewCapabilities() {
    return withNewCapabilitiesLike(java.util.Optional.ofNullable(buildCapabilities()).orElse(new CapabilitiesBuilder().build()));
  }
  
  public CapabilitiesNested editOrNewCapabilitiesLike(Capabilities item) {
    return withNewCapabilitiesLike(java.util.Optional.ofNullable(buildCapabilities()).orElse(item));
  }
  
  public A addToCompute(int index,MachinePool item) {
    if (this.compute == null) {this.compute = new ArrayList();}
    MachinePoolBuilder builder = new MachinePoolBuilder(item);
    if (index < 0 || index >= compute.size()) { _visitables.get("compute").add(builder); compute.add(builder); } else { _visitables.get("compute").add(index, builder); compute.add(index, builder);}
    return (A)this;
  }
  
  public A setToCompute(int index,MachinePool item) {
    if (this.compute == null) {this.compute = new ArrayList();}
    MachinePoolBuilder builder = new MachinePoolBuilder(item);
    if (index < 0 || index >= compute.size()) { _visitables.get("compute").add(builder); compute.add(builder); } else { _visitables.get("compute").set(index, builder); compute.set(index, builder);}
    return (A)this;
  }
  
  public A addToCompute(io.fabric8.openshift.api.model.installer.v1.MachinePool... items) {
    if (this.compute == null) {this.compute = new ArrayList();}
    for (MachinePool item : items) {MachinePoolBuilder builder = new MachinePoolBuilder(item);_visitables.get("compute").add(builder);this.compute.add(builder);} return (A)this;
  }
  
  public A addAllToCompute(Collection items) {
    if (this.compute == null) {this.compute = new ArrayList();}
    for (MachinePool item : items) {MachinePoolBuilder builder = new MachinePoolBuilder(item);_visitables.get("compute").add(builder);this.compute.add(builder);} return (A)this;
  }
  
  public A removeFromCompute(io.fabric8.openshift.api.model.installer.v1.MachinePool... items) {
    if (this.compute == null) return (A)this;
    for (MachinePool item : items) {MachinePoolBuilder builder = new MachinePoolBuilder(item);_visitables.get("compute").remove(builder); this.compute.remove(builder);} return (A)this;
  }
  
  public A removeAllFromCompute(Collection items) {
    if (this.compute == null) return (A)this;
    for (MachinePool item : items) {MachinePoolBuilder builder = new MachinePoolBuilder(item);_visitables.get("compute").remove(builder); this.compute.remove(builder);} return (A)this;
  }
  
  public A removeMatchingFromCompute(Predicate predicate) {
    if (compute == null) return (A) this;
    final Iterator each = compute.iterator();
    final List visitables = _visitables.get("compute");
    while (each.hasNext()) {
      MachinePoolBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  public List buildCompute() {
    return this.compute != null ? build(compute) : null;
  }
  
  public MachinePool buildCompute(int index) {
    return this.compute.get(index).build();
  }
  
  public MachinePool buildFirstCompute() {
    return this.compute.get(0).build();
  }
  
  public MachinePool buildLastCompute() {
    return this.compute.get(compute.size() - 1).build();
  }
  
  public MachinePool buildMatchingCompute(Predicate predicate) {
      for (MachinePoolBuilder item : compute) {
        if (predicate.test(item)) {
          return item.build();
        }
      }
      return null;
  }
  
  public boolean hasMatchingCompute(Predicate predicate) {
      for (MachinePoolBuilder item : compute) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withCompute(List compute) {
    if (this.compute != null) {
      this._visitables.get("compute").clear();
    }
    if (compute != null) {
        this.compute = new ArrayList();
        for (MachinePool item : compute) {
          this.addToCompute(item);
        }
    } else {
      this.compute = null;
    }
    return (A) this;
  }
  
  public A withCompute(io.fabric8.openshift.api.model.installer.v1.MachinePool... compute) {
    if (this.compute != null) {
        this.compute.clear();
        _visitables.remove("compute");
    }
    if (compute != null) {
      for (MachinePool item : compute) {
        this.addToCompute(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasCompute() {
    return this.compute != null && !this.compute.isEmpty();
  }
  
  public ComputeNested addNewCompute() {
    return new ComputeNested(-1, null);
  }
  
  public ComputeNested addNewComputeLike(MachinePool item) {
    return new ComputeNested(-1, item);
  }
  
  public ComputeNested setNewComputeLike(int index,MachinePool item) {
    return new ComputeNested(index, item);
  }
  
  public ComputeNested editCompute(int index) {
    if (compute.size() <= index) throw new RuntimeException("Can't edit compute. Index exceeds size.");
    return setNewComputeLike(index, buildCompute(index));
  }
  
  public ComputeNested editFirstCompute() {
    if (compute.size() == 0) throw new RuntimeException("Can't edit first compute. The list is empty.");
    return setNewComputeLike(0, buildCompute(0));
  }
  
  public ComputeNested editLastCompute() {
    int index = compute.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last compute. The list is empty.");
    return setNewComputeLike(index, buildCompute(index));
  }
  
  public ComputeNested editMatchingCompute(Predicate predicate) {
    int index = -1;
    for (int i=0;i withNewControlPlane() {
    return new ControlPlaneNested(null);
  }
  
  public ControlPlaneNested withNewControlPlaneLike(MachinePool item) {
    return new ControlPlaneNested(item);
  }
  
  public ControlPlaneNested editControlPlane() {
    return withNewControlPlaneLike(java.util.Optional.ofNullable(buildControlPlane()).orElse(null));
  }
  
  public ControlPlaneNested editOrNewControlPlane() {
    return withNewControlPlaneLike(java.util.Optional.ofNullable(buildControlPlane()).orElse(new MachinePoolBuilder().build()));
  }
  
  public ControlPlaneNested editOrNewControlPlaneLike(MachinePool item) {
    return withNewControlPlaneLike(java.util.Optional.ofNullable(buildControlPlane()).orElse(item));
  }
  
  public String getCpuPartitioningMode() {
    return this.cpuPartitioningMode;
  }
  
  public A withCpuPartitioningMode(String cpuPartitioningMode) {
    this.cpuPartitioningMode = cpuPartitioningMode;
    return (A) this;
  }
  
  public boolean hasCpuPartitioningMode() {
    return this.cpuPartitioningMode != null;
  }
  
  public String getCredentialsMode() {
    return this.credentialsMode;
  }
  
  public A withCredentialsMode(String credentialsMode) {
    this.credentialsMode = credentialsMode;
    return (A) this;
  }
  
  public boolean hasCredentialsMode() {
    return this.credentialsMode != null;
  }
  
  public A addToFeatureGates(int index,String item) {
    if (this.featureGates == null) {this.featureGates = new ArrayList();}
    this.featureGates.add(index, item);
    return (A)this;
  }
  
  public A setToFeatureGates(int index,String item) {
    if (this.featureGates == null) {this.featureGates = new ArrayList();}
    this.featureGates.set(index, item); return (A)this;
  }
  
  public A addToFeatureGates(java.lang.String... items) {
    if (this.featureGates == null) {this.featureGates = new ArrayList();}
    for (String item : items) {this.featureGates.add(item);} return (A)this;
  }
  
  public A addAllToFeatureGates(Collection items) {
    if (this.featureGates == null) {this.featureGates = new ArrayList();}
    for (String item : items) {this.featureGates.add(item);} return (A)this;
  }
  
  public A removeFromFeatureGates(java.lang.String... items) {
    if (this.featureGates == null) return (A)this;
    for (String item : items) { this.featureGates.remove(item);} return (A)this;
  }
  
  public A removeAllFromFeatureGates(Collection items) {
    if (this.featureGates == null) return (A)this;
    for (String item : items) { this.featureGates.remove(item);} return (A)this;
  }
  
  public List getFeatureGates() {
    return this.featureGates;
  }
  
  public String getFeatureGate(int index) {
    return this.featureGates.get(index);
  }
  
  public String getFirstFeatureGate() {
    return this.featureGates.get(0);
  }
  
  public String getLastFeatureGate() {
    return this.featureGates.get(featureGates.size() - 1);
  }
  
  public String getMatchingFeatureGate(Predicate predicate) {
      for (String item : featureGates) {
        if (predicate.test(item)) {
          return item;
        }
      }
      return null;
  }
  
  public boolean hasMatchingFeatureGate(Predicate predicate) {
      for (String item : featureGates) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withFeatureGates(List featureGates) {
    if (featureGates != null) {
        this.featureGates = new ArrayList();
        for (String item : featureGates) {
          this.addToFeatureGates(item);
        }
    } else {
      this.featureGates = null;
    }
    return (A) this;
  }
  
  public A withFeatureGates(java.lang.String... featureGates) {
    if (this.featureGates != null) {
        this.featureGates.clear();
        _visitables.remove("featureGates");
    }
    if (featureGates != null) {
      for (String item : featureGates) {
        this.addToFeatureGates(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasFeatureGates() {
    return this.featureGates != null && !this.featureGates.isEmpty();
  }
  
  public String getFeatureSet() {
    return this.featureSet;
  }
  
  public A withFeatureSet(String featureSet) {
    this.featureSet = featureSet;
    return (A) this;
  }
  
  public boolean hasFeatureSet() {
    return this.featureSet != null;
  }
  
  public Boolean getFips() {
    return this.fips;
  }
  
  public A withFips(Boolean fips) {
    this.fips = fips;
    return (A) this;
  }
  
  public boolean hasFips() {
    return this.fips != null;
  }
  
  public A addToImageContentSources(int index,ImageContentSource item) {
    if (this.imageContentSources == null) {this.imageContentSources = new ArrayList();}
    ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);
    if (index < 0 || index >= imageContentSources.size()) { _visitables.get("imageContentSources").add(builder); imageContentSources.add(builder); } else { _visitables.get("imageContentSources").add(index, builder); imageContentSources.add(index, builder);}
    return (A)this;
  }
  
  public A setToImageContentSources(int index,ImageContentSource item) {
    if (this.imageContentSources == null) {this.imageContentSources = new ArrayList();}
    ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);
    if (index < 0 || index >= imageContentSources.size()) { _visitables.get("imageContentSources").add(builder); imageContentSources.add(builder); } else { _visitables.get("imageContentSources").set(index, builder); imageContentSources.set(index, builder);}
    return (A)this;
  }
  
  public A addToImageContentSources(io.fabric8.openshift.api.model.installer.v1.ImageContentSource... items) {
    if (this.imageContentSources == null) {this.imageContentSources = new ArrayList();}
    for (ImageContentSource item : items) {ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);_visitables.get("imageContentSources").add(builder);this.imageContentSources.add(builder);} return (A)this;
  }
  
  public A addAllToImageContentSources(Collection items) {
    if (this.imageContentSources == null) {this.imageContentSources = new ArrayList();}
    for (ImageContentSource item : items) {ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);_visitables.get("imageContentSources").add(builder);this.imageContentSources.add(builder);} return (A)this;
  }
  
  public A removeFromImageContentSources(io.fabric8.openshift.api.model.installer.v1.ImageContentSource... items) {
    if (this.imageContentSources == null) return (A)this;
    for (ImageContentSource item : items) {ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);_visitables.get("imageContentSources").remove(builder); this.imageContentSources.remove(builder);} return (A)this;
  }
  
  public A removeAllFromImageContentSources(Collection items) {
    if (this.imageContentSources == null) return (A)this;
    for (ImageContentSource item : items) {ImageContentSourceBuilder builder = new ImageContentSourceBuilder(item);_visitables.get("imageContentSources").remove(builder); this.imageContentSources.remove(builder);} return (A)this;
  }
  
  public A removeMatchingFromImageContentSources(Predicate predicate) {
    if (imageContentSources == null) return (A) this;
    final Iterator each = imageContentSources.iterator();
    final List visitables = _visitables.get("imageContentSources");
    while (each.hasNext()) {
      ImageContentSourceBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  public List buildImageContentSources() {
    return this.imageContentSources != null ? build(imageContentSources) : null;
  }
  
  public ImageContentSource buildImageContentSource(int index) {
    return this.imageContentSources.get(index).build();
  }
  
  public ImageContentSource buildFirstImageContentSource() {
    return this.imageContentSources.get(0).build();
  }
  
  public ImageContentSource buildLastImageContentSource() {
    return this.imageContentSources.get(imageContentSources.size() - 1).build();
  }
  
  public ImageContentSource buildMatchingImageContentSource(Predicate predicate) {
      for (ImageContentSourceBuilder item : imageContentSources) {
        if (predicate.test(item)) {
          return item.build();
        }
      }
      return null;
  }
  
  public boolean hasMatchingImageContentSource(Predicate predicate) {
      for (ImageContentSourceBuilder item : imageContentSources) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withImageContentSources(List imageContentSources) {
    if (this.imageContentSources != null) {
      this._visitables.get("imageContentSources").clear();
    }
    if (imageContentSources != null) {
        this.imageContentSources = new ArrayList();
        for (ImageContentSource item : imageContentSources) {
          this.addToImageContentSources(item);
        }
    } else {
      this.imageContentSources = null;
    }
    return (A) this;
  }
  
  public A withImageContentSources(io.fabric8.openshift.api.model.installer.v1.ImageContentSource... imageContentSources) {
    if (this.imageContentSources != null) {
        this.imageContentSources.clear();
        _visitables.remove("imageContentSources");
    }
    if (imageContentSources != null) {
      for (ImageContentSource item : imageContentSources) {
        this.addToImageContentSources(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasImageContentSources() {
    return this.imageContentSources != null && !this.imageContentSources.isEmpty();
  }
  
  public ImageContentSourcesNested addNewImageContentSource() {
    return new ImageContentSourcesNested(-1, null);
  }
  
  public ImageContentSourcesNested addNewImageContentSourceLike(ImageContentSource item) {
    return new ImageContentSourcesNested(-1, item);
  }
  
  public ImageContentSourcesNested setNewImageContentSourceLike(int index,ImageContentSource item) {
    return new ImageContentSourcesNested(index, item);
  }
  
  public ImageContentSourcesNested editImageContentSource(int index) {
    if (imageContentSources.size() <= index) throw new RuntimeException("Can't edit imageContentSources. Index exceeds size.");
    return setNewImageContentSourceLike(index, buildImageContentSource(index));
  }
  
  public ImageContentSourcesNested editFirstImageContentSource() {
    if (imageContentSources.size() == 0) throw new RuntimeException("Can't edit first imageContentSources. The list is empty.");
    return setNewImageContentSourceLike(0, buildImageContentSource(0));
  }
  
  public ImageContentSourcesNested editLastImageContentSource() {
    int index = imageContentSources.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last imageContentSources. The list is empty.");
    return setNewImageContentSourceLike(index, buildImageContentSource(index));
  }
  
  public ImageContentSourcesNested editMatchingImageContentSource(Predicate predicate) {
    int index = -1;
    for (int i=0;i();}
    ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);
    if (index < 0 || index >= imageDigestSources.size()) { _visitables.get("imageDigestSources").add(builder); imageDigestSources.add(builder); } else { _visitables.get("imageDigestSources").add(index, builder); imageDigestSources.add(index, builder);}
    return (A)this;
  }
  
  public A setToImageDigestSources(int index,ImageDigestSource item) {
    if (this.imageDigestSources == null) {this.imageDigestSources = new ArrayList();}
    ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);
    if (index < 0 || index >= imageDigestSources.size()) { _visitables.get("imageDigestSources").add(builder); imageDigestSources.add(builder); } else { _visitables.get("imageDigestSources").set(index, builder); imageDigestSources.set(index, builder);}
    return (A)this;
  }
  
  public A addToImageDigestSources(io.fabric8.openshift.api.model.installer.v1.ImageDigestSource... items) {
    if (this.imageDigestSources == null) {this.imageDigestSources = new ArrayList();}
    for (ImageDigestSource item : items) {ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);_visitables.get("imageDigestSources").add(builder);this.imageDigestSources.add(builder);} return (A)this;
  }
  
  public A addAllToImageDigestSources(Collection items) {
    if (this.imageDigestSources == null) {this.imageDigestSources = new ArrayList();}
    for (ImageDigestSource item : items) {ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);_visitables.get("imageDigestSources").add(builder);this.imageDigestSources.add(builder);} return (A)this;
  }
  
  public A removeFromImageDigestSources(io.fabric8.openshift.api.model.installer.v1.ImageDigestSource... items) {
    if (this.imageDigestSources == null) return (A)this;
    for (ImageDigestSource item : items) {ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);_visitables.get("imageDigestSources").remove(builder); this.imageDigestSources.remove(builder);} return (A)this;
  }
  
  public A removeAllFromImageDigestSources(Collection items) {
    if (this.imageDigestSources == null) return (A)this;
    for (ImageDigestSource item : items) {ImageDigestSourceBuilder builder = new ImageDigestSourceBuilder(item);_visitables.get("imageDigestSources").remove(builder); this.imageDigestSources.remove(builder);} return (A)this;
  }
  
  public A removeMatchingFromImageDigestSources(Predicate predicate) {
    if (imageDigestSources == null) return (A) this;
    final Iterator each = imageDigestSources.iterator();
    final List visitables = _visitables.get("imageDigestSources");
    while (each.hasNext()) {
      ImageDigestSourceBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  
  public List buildImageDigestSources() {
    return this.imageDigestSources != null ? build(imageDigestSources) : null;
  }
  
  public ImageDigestSource buildImageDigestSource(int index) {
    return this.imageDigestSources.get(index).build();
  }
  
  public ImageDigestSource buildFirstImageDigestSource() {
    return this.imageDigestSources.get(0).build();
  }
  
  public ImageDigestSource buildLastImageDigestSource() {
    return this.imageDigestSources.get(imageDigestSources.size() - 1).build();
  }
  
  public ImageDigestSource buildMatchingImageDigestSource(Predicate predicate) {
      for (ImageDigestSourceBuilder item : imageDigestSources) {
        if (predicate.test(item)) {
          return item.build();
        }
      }
      return null;
  }
  
  public boolean hasMatchingImageDigestSource(Predicate predicate) {
      for (ImageDigestSourceBuilder item : imageDigestSources) {
        if (predicate.test(item)) {
          return true;
        }
      }
      return false;
  }
  
  public A withImageDigestSources(List imageDigestSources) {
    if (this.imageDigestSources != null) {
      this._visitables.get("imageDigestSources").clear();
    }
    if (imageDigestSources != null) {
        this.imageDigestSources = new ArrayList();
        for (ImageDigestSource item : imageDigestSources) {
          this.addToImageDigestSources(item);
        }
    } else {
      this.imageDigestSources = null;
    }
    return (A) this;
  }
  
  public A withImageDigestSources(io.fabric8.openshift.api.model.installer.v1.ImageDigestSource... imageDigestSources) {
    if (this.imageDigestSources != null) {
        this.imageDigestSources.clear();
        _visitables.remove("imageDigestSources");
    }
    if (imageDigestSources != null) {
      for (ImageDigestSource item : imageDigestSources) {
        this.addToImageDigestSources(item);
      }
    }
    return (A) this;
  }
  
  public boolean hasImageDigestSources() {
    return this.imageDigestSources != null && !this.imageDigestSources.isEmpty();
  }
  
  public ImageDigestSourcesNested addNewImageDigestSource() {
    return new ImageDigestSourcesNested(-1, null);
  }
  
  public ImageDigestSourcesNested addNewImageDigestSourceLike(ImageDigestSource item) {
    return new ImageDigestSourcesNested(-1, item);
  }
  
  public ImageDigestSourcesNested setNewImageDigestSourceLike(int index,ImageDigestSource item) {
    return new ImageDigestSourcesNested(index, item);
  }
  
  public ImageDigestSourcesNested editImageDigestSource(int index) {
    if (imageDigestSources.size() <= index) throw new RuntimeException("Can't edit imageDigestSources. Index exceeds size.");
    return setNewImageDigestSourceLike(index, buildImageDigestSource(index));
  }
  
  public ImageDigestSourcesNested editFirstImageDigestSource() {
    if (imageDigestSources.size() == 0) throw new RuntimeException("Can't edit first imageDigestSources. The list is empty.");
    return setNewImageDigestSourceLike(0, buildImageDigestSource(0));
  }
  
  public ImageDigestSourcesNested editLastImageDigestSource() {
    int index = imageDigestSources.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last imageDigestSources. The list is empty.");
    return setNewImageDigestSourceLike(index, buildImageDigestSource(index));
  }
  
  public ImageDigestSourcesNested editMatchingImageDigestSource(Predicate predicate) {
    int index = -1;
    for (int i=0;i withNewMetadata() {
    return new MetadataNested(null);
  }
  
  public MetadataNested withNewMetadataLike(ObjectMeta item) {
    return new MetadataNested(item);
  }
  
  public MetadataNested editMetadata() {
    return withNewMetadataLike(java.util.Optional.ofNullable(buildMetadata()).orElse(null));
  }
  
  public MetadataNested editOrNewMetadata() {
    return withNewMetadataLike(java.util.Optional.ofNullable(buildMetadata()).orElse(new ObjectMetaBuilder().build()));
  }
  
  public MetadataNested editOrNewMetadataLike(ObjectMeta item) {
    return withNewMetadataLike(java.util.Optional.ofNullable(buildMetadata()).orElse(item));
  }
  
  public Networking buildNetworking() {
    return this.networking != null ? this.networking.build() : null;
  }
  
  public A withNetworking(Networking networking) {
    this._visitables.remove("networking");
    if (networking != null) {
        this.networking = new NetworkingBuilder(networking);
        this._visitables.get("networking").add(this.networking);
    } else {
        this.networking = null;
        this._visitables.get("networking").remove(this.networking);
    }
    return (A) this;
  }
  
  public boolean hasNetworking() {
    return this.networking != null;
  }
  
  public NetworkingNested withNewNetworking() {
    return new NetworkingNested(null);
  }
  
  public NetworkingNested withNewNetworkingLike(Networking item) {
    return new NetworkingNested(item);
  }
  
  public NetworkingNested editNetworking() {
    return withNewNetworkingLike(java.util.Optional.ofNullable(buildNetworking()).orElse(null));
  }
  
  public NetworkingNested editOrNewNetworking() {
    return withNewNetworkingLike(java.util.Optional.ofNullable(buildNetworking()).orElse(new NetworkingBuilder().build()));
  }
  
  public NetworkingNested editOrNewNetworkingLike(Networking item) {
    return withNewNetworkingLike(java.util.Optional.ofNullable(buildNetworking()).orElse(item));
  }
  
  public OperatorPublishingStrategy buildOperatorPublishingStrategy() {
    return this.operatorPublishingStrategy != null ? this.operatorPublishingStrategy.build() : null;
  }
  
  public A withOperatorPublishingStrategy(OperatorPublishingStrategy operatorPublishingStrategy) {
    this._visitables.remove("operatorPublishingStrategy");
    if (operatorPublishingStrategy != null) {
        this.operatorPublishingStrategy = new OperatorPublishingStrategyBuilder(operatorPublishingStrategy);
        this._visitables.get("operatorPublishingStrategy").add(this.operatorPublishingStrategy);
    } else {
        this.operatorPublishingStrategy = null;
        this._visitables.get("operatorPublishingStrategy").remove(this.operatorPublishingStrategy);
    }
    return (A) this;
  }
  
  public boolean hasOperatorPublishingStrategy() {
    return this.operatorPublishingStrategy != null;
  }
  
  public A withNewOperatorPublishingStrategy(String apiserver,String ingress) {
    return (A)withOperatorPublishingStrategy(new OperatorPublishingStrategy(apiserver, ingress));
  }
  
  public OperatorPublishingStrategyNested withNewOperatorPublishingStrategy() {
    return new OperatorPublishingStrategyNested(null);
  }
  
  public OperatorPublishingStrategyNested withNewOperatorPublishingStrategyLike(OperatorPublishingStrategy item) {
    return new OperatorPublishingStrategyNested(item);
  }
  
  public OperatorPublishingStrategyNested editOperatorPublishingStrategy() {
    return withNewOperatorPublishingStrategyLike(java.util.Optional.ofNullable(buildOperatorPublishingStrategy()).orElse(null));
  }
  
  public OperatorPublishingStrategyNested editOrNewOperatorPublishingStrategy() {
    return withNewOperatorPublishingStrategyLike(java.util.Optional.ofNullable(buildOperatorPublishingStrategy()).orElse(new OperatorPublishingStrategyBuilder().build()));
  }
  
  public OperatorPublishingStrategyNested editOrNewOperatorPublishingStrategyLike(OperatorPublishingStrategy item) {
    return withNewOperatorPublishingStrategyLike(java.util.Optional.ofNullable(buildOperatorPublishingStrategy()).orElse(item));
  }
  
  public Platform buildPlatform() {
    return this.platform != null ? this.platform.build() : null;
  }
  
  public A withPlatform(Platform platform) {
    this._visitables.remove("platform");
    if (platform != null) {
        this.platform = new PlatformBuilder(platform);
        this._visitables.get("platform").add(this.platform);
    } else {
        this.platform = null;
        this._visitables.get("platform").remove(this.platform);
    }
    return (A) this;
  }
  
  public boolean hasPlatform() {
    return this.platform != null;
  }
  
  public PlatformNested withNewPlatform() {
    return new PlatformNested(null);
  }
  
  public PlatformNested withNewPlatformLike(Platform item) {
    return new PlatformNested(item);
  }
  
  public PlatformNested editPlatform() {
    return withNewPlatformLike(java.util.Optional.ofNullable(buildPlatform()).orElse(null));
  }
  
  public PlatformNested editOrNewPlatform() {
    return withNewPlatformLike(java.util.Optional.ofNullable(buildPlatform()).orElse(new PlatformBuilder().build()));
  }
  
  public PlatformNested editOrNewPlatformLike(Platform item) {
    return withNewPlatformLike(java.util.Optional.ofNullable(buildPlatform()).orElse(item));
  }
  
  public Proxy buildProxy() {
    return this.proxy != null ? this.proxy.build() : null;
  }
  
  public A withProxy(Proxy proxy) {
    this._visitables.remove("proxy");
    if (proxy != null) {
        this.proxy = new ProxyBuilder(proxy);
        this._visitables.get("proxy").add(this.proxy);
    } else {
        this.proxy = null;
        this._visitables.get("proxy").remove(this.proxy);
    }
    return (A) this;
  }
  
  public boolean hasProxy() {
    return this.proxy != null;
  }
  
  public A withNewProxy(String httpProxy,String httpsProxy,String noProxy) {
    return (A)withProxy(new Proxy(httpProxy, httpsProxy, noProxy));
  }
  
  public ProxyNested withNewProxy() {
    return new ProxyNested(null);
  }
  
  public ProxyNested withNewProxyLike(Proxy item) {
    return new ProxyNested(item);
  }
  
  public ProxyNested editProxy() {
    return withNewProxyLike(java.util.Optional.ofNullable(buildProxy()).orElse(null));
  }
  
  public ProxyNested editOrNewProxy() {
    return withNewProxyLike(java.util.Optional.ofNullable(buildProxy()).orElse(new ProxyBuilder().build()));
  }
  
  public ProxyNested editOrNewProxyLike(Proxy item) {
    return withNewProxyLike(java.util.Optional.ofNullable(buildProxy()).orElse(item));
  }
  
  public String getPublish() {
    return this.publish;
  }
  
  public A withPublish(String publish) {
    this.publish = publish;
    return (A) this;
  }
  
  public boolean hasPublish() {
    return this.publish != null;
  }
  
  public String getPullSecret() {
    return this.pullSecret;
  }
  
  public A withPullSecret(String pullSecret) {
    this.pullSecret = pullSecret;
    return (A) this;
  }
  
  public boolean hasPullSecret() {
    return this.pullSecret != null;
  }
  
  public String getSshKey() {
    return this.sshKey;
  }
  
  public A withSshKey(String sshKey) {
    this.sshKey = sshKey;
    return (A) this;
  }
  
  public boolean hasSshKey() {
    return this.sshKey != null;
  }
  
  public A addToAdditionalProperties(String key,Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  
  public A addToAdditionalProperties(Map 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;
    InstallConfigFluent that = (InstallConfigFluent) o;
    if (!java.util.Objects.equals(additionalTrustBundle, that.additionalTrustBundle)) return false;
    if (!java.util.Objects.equals(additionalTrustBundlePolicy, that.additionalTrustBundlePolicy)) return false;
    if (!java.util.Objects.equals(apiVersion, that.apiVersion)) return false;
    if (!java.util.Objects.equals(baseDomain, that.baseDomain)) return false;
    if (!java.util.Objects.equals(bootstrapInPlace, that.bootstrapInPlace)) return false;
    if (!java.util.Objects.equals(capabilities, that.capabilities)) return false;
    if (!java.util.Objects.equals(compute, that.compute)) return false;
    if (!java.util.Objects.equals(controlPlane, that.controlPlane)) return false;
    if (!java.util.Objects.equals(cpuPartitioningMode, that.cpuPartitioningMode)) return false;
    if (!java.util.Objects.equals(credentialsMode, that.credentialsMode)) return false;
    if (!java.util.Objects.equals(featureGates, that.featureGates)) return false;
    if (!java.util.Objects.equals(featureSet, that.featureSet)) return false;
    if (!java.util.Objects.equals(fips, that.fips)) return false;
    if (!java.util.Objects.equals(imageContentSources, that.imageContentSources)) return false;
    if (!java.util.Objects.equals(imageDigestSources, that.imageDigestSources)) return false;
    if (!java.util.Objects.equals(kind, that.kind)) return false;
    if (!java.util.Objects.equals(metadata, that.metadata)) return false;
    if (!java.util.Objects.equals(networking, that.networking)) return false;
    if (!java.util.Objects.equals(operatorPublishingStrategy, that.operatorPublishingStrategy)) return false;
    if (!java.util.Objects.equals(platform, that.platform)) return false;
    if (!java.util.Objects.equals(proxy, that.proxy)) return false;
    if (!java.util.Objects.equals(publish, that.publish)) return false;
    if (!java.util.Objects.equals(pullSecret, that.pullSecret)) return false;
    if (!java.util.Objects.equals(sshKey, that.sshKey)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(additionalTrustBundle,  additionalTrustBundlePolicy,  apiVersion,  baseDomain,  bootstrapInPlace,  capabilities,  compute,  controlPlane,  cpuPartitioningMode,  credentialsMode,  featureGates,  featureSet,  fips,  imageContentSources,  imageDigestSources,  kind,  metadata,  networking,  operatorPublishingStrategy,  platform,  proxy,  publish,  pullSecret,  sshKey,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (additionalTrustBundle != null) { sb.append("additionalTrustBundle:"); sb.append(additionalTrustBundle + ","); }
    if (additionalTrustBundlePolicy != null) { sb.append("additionalTrustBundlePolicy:"); sb.append(additionalTrustBundlePolicy + ","); }
    if (apiVersion != null) { sb.append("apiVersion:"); sb.append(apiVersion + ","); }
    if (baseDomain != null) { sb.append("baseDomain:"); sb.append(baseDomain + ","); }
    if (bootstrapInPlace != null) { sb.append("bootstrapInPlace:"); sb.append(bootstrapInPlace + ","); }
    if (capabilities != null) { sb.append("capabilities:"); sb.append(capabilities + ","); }
    if (compute != null && !compute.isEmpty()) { sb.append("compute:"); sb.append(compute + ","); }
    if (controlPlane != null) { sb.append("controlPlane:"); sb.append(controlPlane + ","); }
    if (cpuPartitioningMode != null) { sb.append("cpuPartitioningMode:"); sb.append(cpuPartitioningMode + ","); }
    if (credentialsMode != null) { sb.append("credentialsMode:"); sb.append(credentialsMode + ","); }
    if (featureGates != null && !featureGates.isEmpty()) { sb.append("featureGates:"); sb.append(featureGates + ","); }
    if (featureSet != null) { sb.append("featureSet:"); sb.append(featureSet + ","); }
    if (fips != null) { sb.append("fips:"); sb.append(fips + ","); }
    if (imageContentSources != null && !imageContentSources.isEmpty()) { sb.append("imageContentSources:"); sb.append(imageContentSources + ","); }
    if (imageDigestSources != null && !imageDigestSources.isEmpty()) { sb.append("imageDigestSources:"); sb.append(imageDigestSources + ","); }
    if (kind != null) { sb.append("kind:"); sb.append(kind + ","); }
    if (metadata != null) { sb.append("metadata:"); sb.append(metadata + ","); }
    if (networking != null) { sb.append("networking:"); sb.append(networking + ","); }
    if (operatorPublishingStrategy != null) { sb.append("operatorPublishingStrategy:"); sb.append(operatorPublishingStrategy + ","); }
    if (platform != null) { sb.append("platform:"); sb.append(platform + ","); }
    if (proxy != null) { sb.append("proxy:"); sb.append(proxy + ","); }
    if (publish != null) { sb.append("publish:"); sb.append(publish + ","); }
    if (pullSecret != null) { sb.append("pullSecret:"); sb.append(pullSecret + ","); }
    if (sshKey != null) { sb.append("sshKey:"); sb.append(sshKey + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  
  public A withFips() {
    return withFips(true);
  }
  public class BootstrapInPlaceNested extends BootstrapInPlaceFluent> implements Nested{
    BootstrapInPlaceNested(BootstrapInPlace item) {
      this.builder = new BootstrapInPlaceBuilder(this, item);
    }
    BootstrapInPlaceBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withBootstrapInPlace(builder.build());
    }
    
    public N endBootstrapInPlace() {
      return and();
    }
    
  
  }
  public class CapabilitiesNested extends CapabilitiesFluent> implements Nested{
    CapabilitiesNested(Capabilities item) {
      this.builder = new CapabilitiesBuilder(this, item);
    }
    CapabilitiesBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withCapabilities(builder.build());
    }
    
    public N endCapabilities() {
      return and();
    }
    
  
  }
  public class ComputeNested extends MachinePoolFluent> implements Nested{
    ComputeNested(int index,MachinePool item) {
      this.index = index;
      this.builder = new MachinePoolBuilder(this, item);
    }
    MachinePoolBuilder builder;
    int index;
    
    public N and() {
      return (N) InstallConfigFluent.this.setToCompute(index,builder.build());
    }
    
    public N endCompute() {
      return and();
    }
    
  
  }
  public class ControlPlaneNested extends MachinePoolFluent> implements Nested{
    ControlPlaneNested(MachinePool item) {
      this.builder = new MachinePoolBuilder(this, item);
    }
    MachinePoolBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withControlPlane(builder.build());
    }
    
    public N endControlPlane() {
      return and();
    }
    
  
  }
  public class ImageContentSourcesNested extends ImageContentSourceFluent> implements Nested{
    ImageContentSourcesNested(int index,ImageContentSource item) {
      this.index = index;
      this.builder = new ImageContentSourceBuilder(this, item);
    }
    ImageContentSourceBuilder builder;
    int index;
    
    public N and() {
      return (N) InstallConfigFluent.this.setToImageContentSources(index,builder.build());
    }
    
    public N endImageContentSource() {
      return and();
    }
    
  
  }
  public class ImageDigestSourcesNested extends ImageDigestSourceFluent> implements Nested{
    ImageDigestSourcesNested(int index,ImageDigestSource item) {
      this.index = index;
      this.builder = new ImageDigestSourceBuilder(this, item);
    }
    ImageDigestSourceBuilder builder;
    int index;
    
    public N and() {
      return (N) InstallConfigFluent.this.setToImageDigestSources(index,builder.build());
    }
    
    public N endImageDigestSource() {
      return and();
    }
    
  
  }
  public class MetadataNested extends ObjectMetaFluent> implements Nested{
    MetadataNested(ObjectMeta item) {
      this.builder = new ObjectMetaBuilder(this, item);
    }
    ObjectMetaBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withMetadata(builder.build());
    }
    
    public N endMetadata() {
      return and();
    }
    
  
  }
  public class NetworkingNested extends NetworkingFluent> implements Nested{
    NetworkingNested(Networking item) {
      this.builder = new NetworkingBuilder(this, item);
    }
    NetworkingBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withNetworking(builder.build());
    }
    
    public N endNetworking() {
      return and();
    }
    
  
  }
  public class OperatorPublishingStrategyNested extends OperatorPublishingStrategyFluent> implements Nested{
    OperatorPublishingStrategyNested(OperatorPublishingStrategy item) {
      this.builder = new OperatorPublishingStrategyBuilder(this, item);
    }
    OperatorPublishingStrategyBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withOperatorPublishingStrategy(builder.build());
    }
    
    public N endOperatorPublishingStrategy() {
      return and();
    }
    
  
  }
  public class PlatformNested extends PlatformFluent> implements Nested{
    PlatformNested(Platform item) {
      this.builder = new PlatformBuilder(this, item);
    }
    PlatformBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withPlatform(builder.build());
    }
    
    public N endPlatform() {
      return and();
    }
    
  
  }
  public class ProxyNested extends ProxyFluent> implements Nested{
    ProxyNested(Proxy item) {
      this.builder = new ProxyBuilder(this, item);
    }
    ProxyBuilder builder;
    
    public N and() {
      return (N) InstallConfigFluent.this.withProxy(builder.build());
    }
    
    public N endProxy() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy