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

io.dekorate.helm.config.HelmChartConfigFluentImpl Maven / Gradle / Ivy

There is a newer version: 4.1.4
Show newest version
package io.dekorate.helm.config;

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.function.Predicate;
import java.lang.Deprecated;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import io.dekorate.kubernetes.config.ConfigurationFluentImpl;
import java.lang.Integer;
import java.util.Collection;
import java.lang.Object;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class HelmChartConfigFluentImpl> extends ConfigurationFluentImpl implements HelmChartConfigFluent{
  public HelmChartConfigFluentImpl() {
  }
  public HelmChartConfigFluentImpl(HelmChartConfig instance) {
    this.withProject(instance.getProject()); 
    this.withAttributes(instance.getAttributes()); 
    this.withEnabled(instance.getEnabled()); 
    this.withName(instance.getName()); 
    this.withApiVersion(instance.getApiVersion()); 
    this.withValuesRootAlias(instance.getValuesRootAlias()); 
    this.withDescription(instance.getDescription()); 
    this.withVersion(instance.getVersion()); 
    this.withIcon(instance.getIcon()); 
    this.withHome(instance.getHome()); 
    this.withKeywords(instance.getKeywords()); 
    this.withSources(instance.getSources()); 
    this.withCreateTarFile(instance.getCreateTarFile()); 
    this.withExtension(instance.getExtension()); 
    this.withNotes(instance.getNotes()); 
    this.withInputFolder(instance.getInputFolder()); 
    this.withOutputFolder(instance.getOutputFolder()); 
    this.withMaintainers(instance.getMaintainers()); 
    this.withDependencies(instance.getDependencies()); 
    this.withValues(instance.getValues()); 
    this.withExpressions(instance.getExpressions()); 
  }
  private Boolean enabled;
  private String name;
  private String apiVersion;
  private String valuesRootAlias;
  private String description;
  private String version;
  private String icon;
  private String home;
  private List keywords = new ArrayList();
  private List sources = new ArrayList();
  private Boolean createTarFile;
  private String extension;
  private String notes;
  private String inputFolder;
  private String outputFolder;
  private ArrayList maintainers = new ArrayList();
  private ArrayList dependencies = new ArrayList();
  private ArrayList values = new ArrayList();
  private ArrayList expressions = new ArrayList();
  public Boolean getEnabled() {
    return this.enabled;
  }
  public A withEnabled(Boolean enabled) {
    this.enabled=enabled; return (A) this;
  }
  public Boolean hasEnabled() {
    return this.enabled != null;
  }
  public String getName() {
    return this.name;
  }
  public A withName(String name) {
    this.name=name; return (A) this;
  }
  public Boolean hasName() {
    return this.name != 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 getValuesRootAlias() {
    return this.valuesRootAlias;
  }
  public A withValuesRootAlias(String valuesRootAlias) {
    this.valuesRootAlias=valuesRootAlias; return (A) this;
  }
  public Boolean hasValuesRootAlias() {
    return this.valuesRootAlias != null;
  }
  public String getDescription() {
    return this.description;
  }
  public A withDescription(String description) {
    this.description=description; return (A) this;
  }
  public Boolean hasDescription() {
    return this.description != null;
  }
  public String getVersion() {
    return this.version;
  }
  public A withVersion(String version) {
    this.version=version; return (A) this;
  }
  public Boolean hasVersion() {
    return this.version != null;
  }
  public String getIcon() {
    return this.icon;
  }
  public A withIcon(String icon) {
    this.icon=icon; return (A) this;
  }
  public Boolean hasIcon() {
    return this.icon != null;
  }
  public String getHome() {
    return this.home;
  }
  public A withHome(String home) {
    this.home=home; return (A) this;
  }
  public Boolean hasHome() {
    return this.home != null;
  }
  public A withKeywords(java.lang.String... keywords) {
    if (this.keywords != null) {this.keywords.clear();}
    if (keywords != null) {for (String item :keywords){ this.addToKeywords(item);}} return (A) this;
  }
  public String[] getKeywords() {
    //This needs to work with primitives, so we use arrays.
int size = keywords != null ? keywords.size() : 0;
String[] result = new String[size];
if (size == 0) {
   return result;
}
int index = 0;
for (String item : keywords) {
    result[index++]=item;
}
return result;

  }
  public A addToKeywords(Integer index,String item) {
    if (this.keywords == null) {this.keywords = new ArrayList();}
    this.keywords.add(index, item);
    return (A)this;
  }
  public A setToKeywords(Integer index,String item) {
    if (this.keywords == null) {this.keywords = new ArrayList();}
    this.keywords.set(index, item); return (A)this;
  }
  public A addToKeywords(java.lang.String... items) {
    if (this.keywords == null) {this.keywords = new ArrayList();}
    for (String item : items) {this.keywords.add(item);} return (A)this;
  }
  public A addAllToKeywords(Collection items) {
    if (this.keywords == null) {this.keywords = new ArrayList();}
    for (String item : items) {this.keywords.add(item);} return (A)this;
  }
  public A removeFromKeywords(java.lang.String... items) {
    for (String item : items) {if (this.keywords!= null){ this.keywords.remove(item);}} return (A)this;
  }
  public A removeAllFromKeywords(Collection items) {
    for (String item : items) {if (this.keywords!= null){ this.keywords.remove(item);}} return (A)this;
  }
  public Boolean hasKeywords() {
    return keywords != null && !keywords.isEmpty();
  }
  public A withSources(java.lang.String... sources) {
    if (this.sources != null) {this.sources.clear();}
    if (sources != null) {for (String item :sources){ this.addToSources(item);}} return (A) this;
  }
  public String[] getSources() {
    //This needs to work with primitives, so we use arrays.
int size = sources != null ? sources.size() : 0;
String[] result = new String[size];
if (size == 0) {
   return result;
}
int index = 0;
for (String item : sources) {
    result[index++]=item;
}
return result;

  }
  public A addToSources(Integer index,String item) {
    if (this.sources == null) {this.sources = new ArrayList();}
    this.sources.add(index, item);
    return (A)this;
  }
  public A setToSources(Integer index,String item) {
    if (this.sources == null) {this.sources = new ArrayList();}
    this.sources.set(index, item); return (A)this;
  }
  public A addToSources(java.lang.String... items) {
    if (this.sources == null) {this.sources = new ArrayList();}
    for (String item : items) {this.sources.add(item);} return (A)this;
  }
  public A addAllToSources(Collection items) {
    if (this.sources == null) {this.sources = new ArrayList();}
    for (String item : items) {this.sources.add(item);} return (A)this;
  }
  public A removeFromSources(java.lang.String... items) {
    for (String item : items) {if (this.sources!= null){ this.sources.remove(item);}} return (A)this;
  }
  public A removeAllFromSources(Collection items) {
    for (String item : items) {if (this.sources!= null){ this.sources.remove(item);}} return (A)this;
  }
  public Boolean hasSources() {
    return sources != null && !sources.isEmpty();
  }
  public Boolean getCreateTarFile() {
    return this.createTarFile;
  }
  public A withCreateTarFile(Boolean createTarFile) {
    this.createTarFile=createTarFile; return (A) this;
  }
  public Boolean hasCreateTarFile() {
    return this.createTarFile != null;
  }
  public String getExtension() {
    return this.extension;
  }
  public A withExtension(String extension) {
    this.extension=extension; return (A) this;
  }
  public Boolean hasExtension() {
    return this.extension != null;
  }
  public String getNotes() {
    return this.notes;
  }
  public A withNotes(String notes) {
    this.notes=notes; return (A) this;
  }
  public Boolean hasNotes() {
    return this.notes != null;
  }
  public String getInputFolder() {
    return this.inputFolder;
  }
  public A withInputFolder(String inputFolder) {
    this.inputFolder=inputFolder; return (A) this;
  }
  public Boolean hasInputFolder() {
    return this.inputFolder != null;
  }
  public String getOutputFolder() {
    return this.outputFolder;
  }
  public A withOutputFolder(String outputFolder) {
    this.outputFolder=outputFolder; return (A) this;
  }
  public Boolean hasOutputFolder() {
    return this.outputFolder != null;
  }
  public A withMaintainers(io.dekorate.helm.config.Maintainer... maintainers) {
    if (this.maintainers != null) {this.maintainers.clear();}
    if (maintainers != null) {for (Maintainer item :maintainers){ this.addToMaintainers(item);}} return (A) this;
  }
  
  /**
   * This method has been deprecated, please use method buildMaintainers instead.
   */
  @Deprecated
  public Maintainer[] getMaintainers() {
    int size = maintainers != null ? maintainers.size() : 0;
Maintainer[] result = new Maintainer[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : maintainers) {
    result[index++]=builder.build();
}
return result;

  }
  public Maintainer[] buildMaintainers() {
    int size = maintainers != null ? maintainers.size() : 0;
Maintainer[] result = new Maintainer[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : maintainers) {
    result[index++]=builder.build();
}
return result;

  }
  public Maintainer buildMaintainer(Integer index) {
    return this.maintainers.get(index).build();
  }
  public Maintainer buildFirstMaintainer() {
    return this.maintainers.get(0).build();
  }
  public Maintainer buildLastMaintainer() {
    return this.maintainers.get(maintainers.size() - 1).build();
  }
  public Maintainer buildMatchingMaintainer(Predicate predicate) {
    for (MaintainerBuilder item: maintainers) { if(predicate.test(item)){ return item.build();} } return null;
  }
  public Boolean hasMatchingMaintainer(Predicate predicate) {
    for (MaintainerBuilder item: maintainers) { if(predicate.test(item)){ return true;} } return false;
  }
  public A addToMaintainers(Integer index,Maintainer item) {
    if (this.maintainers == null) {this.maintainers = new ArrayList();}
    MaintainerBuilder builder = new MaintainerBuilder(item);_visitables.get("maintainers").add(index >= 0 ? index : _visitables.get("maintainers").size(), builder);this.maintainers.add(index >= 0 ? index : maintainers.size(), builder); return (A)this;
  }
  public A setToMaintainers(Integer index,Maintainer item) {
    if (this.maintainers == null) {this.maintainers = new ArrayList();}
    MaintainerBuilder builder = new MaintainerBuilder(item);
    if (index < 0 || index >= _visitables.get("maintainers").size()) { _visitables.get("maintainers").add(builder); } else { _visitables.get("maintainers").set(index, builder);}
    if (index < 0 || index >= maintainers.size()) { maintainers.add(builder); } else { maintainers.set(index, builder);}
     return (A)this;
  }
  public A addToMaintainers(io.dekorate.helm.config.Maintainer... items) {
    if (this.maintainers == null) {this.maintainers = new ArrayList();}
    for (Maintainer item : items) {MaintainerBuilder builder = new MaintainerBuilder(item);_visitables.get("maintainers").add(builder);this.maintainers.add(builder);} return (A)this;
  }
  public A addAllToMaintainers(Collection items) {
    if (this.maintainers == null) {this.maintainers = new ArrayList();}
    for (Maintainer item : items) {MaintainerBuilder builder = new MaintainerBuilder(item);_visitables.get("maintainers").add(builder);this.maintainers.add(builder);} return (A)this;
  }
  public A removeFromMaintainers(io.dekorate.helm.config.Maintainer... items) {
    for (Maintainer item : items) {MaintainerBuilder builder = new MaintainerBuilder(item);_visitables.get("maintainers").remove(builder);if (this.maintainers != null) {this.maintainers.remove(builder);}} return (A)this;
  }
  public A removeAllFromMaintainers(Collection items) {
    for (Maintainer item : items) {MaintainerBuilder builder = new MaintainerBuilder(item);_visitables.get("maintainers").remove(builder);if (this.maintainers != null) {this.maintainers.remove(builder);}} return (A)this;
  }
  public A removeMatchingFromMaintainers(Predicate predicate) {
    if (maintainers == null) return (A) this;
    final Iterator each = maintainers.iterator();
    final List visitables = _visitables.get("maintainers");
    while (each.hasNext()) {
      MaintainerBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  public Boolean hasMaintainers() {
    return maintainers != null && !maintainers.isEmpty();
  }
  public A addNewMaintainer(String name,String email,String url) {
    return (A)addToMaintainers(new Maintainer(name, email, url));
  }
  public HelmChartConfigFluent.MaintainersNested addNewMaintainer() {
    return new HelmChartConfigFluentImpl.MaintainersNestedImpl();
  }
  public HelmChartConfigFluent.MaintainersNested addNewMaintainerLike(Maintainer item) {
    return new HelmChartConfigFluentImpl.MaintainersNestedImpl(-1, item);
  }
  public HelmChartConfigFluent.MaintainersNested setNewMaintainerLike(Integer index,Maintainer item) {
    return new HelmChartConfigFluentImpl.MaintainersNestedImpl(index, item);
  }
  public HelmChartConfigFluent.MaintainersNested editMaintainer(Integer index) {
    if (maintainers.size() <= index) throw new RuntimeException("Can't edit maintainers. Index exceeds size.");
    return setNewMaintainerLike(index, buildMaintainer(index));
  }
  public HelmChartConfigFluent.MaintainersNested editFirstMaintainer() {
    if (maintainers.size() == 0) throw new RuntimeException("Can't edit first maintainers. The list is empty.");
    return setNewMaintainerLike(0, buildMaintainer(0));
  }
  public HelmChartConfigFluent.MaintainersNested editLastMaintainer() {
    int index = maintainers.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last maintainers. The list is empty.");
    return setNewMaintainerLike(index, buildMaintainer(index));
  }
  public HelmChartConfigFluent.MaintainersNested editMatchingMaintainer(Predicate predicate) {
    int index = -1;
    for (int i=0;i builder : dependencies) {
    result[index++]=builder.build();
}
return result;

  }
  public HelmDependency[] buildDependencies() {
    int size = dependencies != null ? dependencies.size() : 0;
HelmDependency[] result = new HelmDependency[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : dependencies) {
    result[index++]=builder.build();
}
return result;

  }
  public HelmDependency buildDependency(Integer index) {
    return this.dependencies.get(index).build();
  }
  public HelmDependency buildFirstDependency() {
    return this.dependencies.get(0).build();
  }
  public HelmDependency buildLastDependency() {
    return this.dependencies.get(dependencies.size() - 1).build();
  }
  public HelmDependency buildMatchingDependency(Predicate predicate) {
    for (HelmDependencyBuilder item: dependencies) { if(predicate.test(item)){ return item.build();} } return null;
  }
  public Boolean hasMatchingDependency(Predicate predicate) {
    for (HelmDependencyBuilder item: dependencies) { if(predicate.test(item)){ return true;} } return false;
  }
  public A addToDependencies(Integer index,HelmDependency item) {
    if (this.dependencies == null) {this.dependencies = new ArrayList();}
    HelmDependencyBuilder builder = new HelmDependencyBuilder(item);_visitables.get("dependencies").add(index >= 0 ? index : _visitables.get("dependencies").size(), builder);this.dependencies.add(index >= 0 ? index : dependencies.size(), builder); return (A)this;
  }
  public A setToDependencies(Integer index,HelmDependency item) {
    if (this.dependencies == null) {this.dependencies = new ArrayList();}
    HelmDependencyBuilder builder = new HelmDependencyBuilder(item);
    if (index < 0 || index >= _visitables.get("dependencies").size()) { _visitables.get("dependencies").add(builder); } else { _visitables.get("dependencies").set(index, builder);}
    if (index < 0 || index >= dependencies.size()) { dependencies.add(builder); } else { dependencies.set(index, builder);}
     return (A)this;
  }
  public A addToDependencies(io.dekorate.helm.config.HelmDependency... items) {
    if (this.dependencies == null) {this.dependencies = new ArrayList();}
    for (HelmDependency item : items) {HelmDependencyBuilder builder = new HelmDependencyBuilder(item);_visitables.get("dependencies").add(builder);this.dependencies.add(builder);} return (A)this;
  }
  public A addAllToDependencies(Collection items) {
    if (this.dependencies == null) {this.dependencies = new ArrayList();}
    for (HelmDependency item : items) {HelmDependencyBuilder builder = new HelmDependencyBuilder(item);_visitables.get("dependencies").add(builder);this.dependencies.add(builder);} return (A)this;
  }
  public A removeFromDependencies(io.dekorate.helm.config.HelmDependency... items) {
    for (HelmDependency item : items) {HelmDependencyBuilder builder = new HelmDependencyBuilder(item);_visitables.get("dependencies").remove(builder);if (this.dependencies != null) {this.dependencies.remove(builder);}} return (A)this;
  }
  public A removeAllFromDependencies(Collection items) {
    for (HelmDependency item : items) {HelmDependencyBuilder builder = new HelmDependencyBuilder(item);_visitables.get("dependencies").remove(builder);if (this.dependencies != null) {this.dependencies.remove(builder);}} return (A)this;
  }
  public A removeMatchingFromDependencies(Predicate predicate) {
    if (dependencies == null) return (A) this;
    final Iterator each = dependencies.iterator();
    final List visitables = _visitables.get("dependencies");
    while (each.hasNext()) {
      HelmDependencyBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  public Boolean hasDependencies() {
    return dependencies != null && !dependencies.isEmpty();
  }
  public HelmChartConfigFluent.DependenciesNested addNewDependency() {
    return new HelmChartConfigFluentImpl.DependenciesNestedImpl();
  }
  public HelmChartConfigFluent.DependenciesNested addNewDependencyLike(HelmDependency item) {
    return new HelmChartConfigFluentImpl.DependenciesNestedImpl(-1, item);
  }
  public HelmChartConfigFluent.DependenciesNested setNewDependencyLike(Integer index,HelmDependency item) {
    return new HelmChartConfigFluentImpl.DependenciesNestedImpl(index, item);
  }
  public HelmChartConfigFluent.DependenciesNested editDependency(Integer index) {
    if (dependencies.size() <= index) throw new RuntimeException("Can't edit dependencies. Index exceeds size.");
    return setNewDependencyLike(index, buildDependency(index));
  }
  public HelmChartConfigFluent.DependenciesNested editFirstDependency() {
    if (dependencies.size() == 0) throw new RuntimeException("Can't edit first dependencies. The list is empty.");
    return setNewDependencyLike(0, buildDependency(0));
  }
  public HelmChartConfigFluent.DependenciesNested editLastDependency() {
    int index = dependencies.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last dependencies. The list is empty.");
    return setNewDependencyLike(index, buildDependency(index));
  }
  public HelmChartConfigFluent.DependenciesNested editMatchingDependency(Predicate predicate) {
    int index = -1;
    for (int i=0;i builder : values) {
    result[index++]=builder.build();
}
return result;

  }
  public ValueReference[] buildValues() {
    int size = values != null ? values.size() : 0;
ValueReference[] result = new ValueReference[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : values) {
    result[index++]=builder.build();
}
return result;

  }
  public ValueReference buildValue(Integer index) {
    return this.values.get(index).build();
  }
  public ValueReference buildFirstValue() {
    return this.values.get(0).build();
  }
  public ValueReference buildLastValue() {
    return this.values.get(values.size() - 1).build();
  }
  public ValueReference buildMatchingValue(Predicate predicate) {
    for (ValueReferenceBuilder item: values) { if(predicate.test(item)){ return item.build();} } return null;
  }
  public Boolean hasMatchingValue(Predicate predicate) {
    for (ValueReferenceBuilder item: values) { if(predicate.test(item)){ return true;} } return false;
  }
  public A addToValues(Integer index,ValueReference item) {
    if (this.values == null) {this.values = new ArrayList();}
    ValueReferenceBuilder builder = new ValueReferenceBuilder(item);_visitables.get("values").add(index >= 0 ? index : _visitables.get("values").size(), builder);this.values.add(index >= 0 ? index : values.size(), builder); return (A)this;
  }
  public A setToValues(Integer index,ValueReference item) {
    if (this.values == null) {this.values = new ArrayList();}
    ValueReferenceBuilder builder = new ValueReferenceBuilder(item);
    if (index < 0 || index >= _visitables.get("values").size()) { _visitables.get("values").add(builder); } else { _visitables.get("values").set(index, builder);}
    if (index < 0 || index >= values.size()) { values.add(builder); } else { values.set(index, builder);}
     return (A)this;
  }
  public A addToValues(io.dekorate.helm.config.ValueReference... items) {
    if (this.values == null) {this.values = new ArrayList();}
    for (ValueReference item : items) {ValueReferenceBuilder builder = new ValueReferenceBuilder(item);_visitables.get("values").add(builder);this.values.add(builder);} return (A)this;
  }
  public A addAllToValues(Collection items) {
    if (this.values == null) {this.values = new ArrayList();}
    for (ValueReference item : items) {ValueReferenceBuilder builder = new ValueReferenceBuilder(item);_visitables.get("values").add(builder);this.values.add(builder);} return (A)this;
  }
  public A removeFromValues(io.dekorate.helm.config.ValueReference... items) {
    for (ValueReference item : items) {ValueReferenceBuilder builder = new ValueReferenceBuilder(item);_visitables.get("values").remove(builder);if (this.values != null) {this.values.remove(builder);}} return (A)this;
  }
  public A removeAllFromValues(Collection items) {
    for (ValueReference item : items) {ValueReferenceBuilder builder = new ValueReferenceBuilder(item);_visitables.get("values").remove(builder);if (this.values != null) {this.values.remove(builder);}} return (A)this;
  }
  public A removeMatchingFromValues(Predicate predicate) {
    if (values == null) return (A) this;
    final Iterator each = values.iterator();
    final List visitables = _visitables.get("values");
    while (each.hasNext()) {
      ValueReferenceBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  public Boolean hasValues() {
    return values != null && !values.isEmpty();
  }
  public A addNewValue(String property,String[] paths,String profile,String value,String expression) {
    return (A)addToValues(new ValueReference(property, paths, profile, value, expression));
  }
  public HelmChartConfigFluent.ValuesNested addNewValue() {
    return new HelmChartConfigFluentImpl.ValuesNestedImpl();
  }
  public HelmChartConfigFluent.ValuesNested addNewValueLike(ValueReference item) {
    return new HelmChartConfigFluentImpl.ValuesNestedImpl(-1, item);
  }
  public HelmChartConfigFluent.ValuesNested setNewValueLike(Integer index,ValueReference item) {
    return new HelmChartConfigFluentImpl.ValuesNestedImpl(index, item);
  }
  public HelmChartConfigFluent.ValuesNested editValue(Integer index) {
    if (values.size() <= index) throw new RuntimeException("Can't edit values. Index exceeds size.");
    return setNewValueLike(index, buildValue(index));
  }
  public HelmChartConfigFluent.ValuesNested editFirstValue() {
    if (values.size() == 0) throw new RuntimeException("Can't edit first values. The list is empty.");
    return setNewValueLike(0, buildValue(0));
  }
  public HelmChartConfigFluent.ValuesNested editLastValue() {
    int index = values.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last values. The list is empty.");
    return setNewValueLike(index, buildValue(index));
  }
  public HelmChartConfigFluent.ValuesNested editMatchingValue(Predicate predicate) {
    int index = -1;
    for (int i=0;i builder : expressions) {
    result[index++]=builder.build();
}
return result;

  }
  public HelmExpression[] buildExpressions() {
    int size = expressions != null ? expressions.size() : 0;
HelmExpression[] result = new HelmExpression[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : expressions) {
    result[index++]=builder.build();
}
return result;

  }
  public HelmExpression buildExpression(Integer index) {
    return this.expressions.get(index).build();
  }
  public HelmExpression buildFirstExpression() {
    return this.expressions.get(0).build();
  }
  public HelmExpression buildLastExpression() {
    return this.expressions.get(expressions.size() - 1).build();
  }
  public HelmExpression buildMatchingExpression(Predicate predicate) {
    for (HelmExpressionBuilder item: expressions) { if(predicate.test(item)){ return item.build();} } return null;
  }
  public Boolean hasMatchingExpression(Predicate predicate) {
    for (HelmExpressionBuilder item: expressions) { if(predicate.test(item)){ return true;} } return false;
  }
  public A addToExpressions(Integer index,HelmExpression item) {
    if (this.expressions == null) {this.expressions = new ArrayList();}
    HelmExpressionBuilder builder = new HelmExpressionBuilder(item);_visitables.get("expressions").add(index >= 0 ? index : _visitables.get("expressions").size(), builder);this.expressions.add(index >= 0 ? index : expressions.size(), builder); return (A)this;
  }
  public A setToExpressions(Integer index,HelmExpression item) {
    if (this.expressions == null) {this.expressions = new ArrayList();}
    HelmExpressionBuilder builder = new HelmExpressionBuilder(item);
    if (index < 0 || index >= _visitables.get("expressions").size()) { _visitables.get("expressions").add(builder); } else { _visitables.get("expressions").set(index, builder);}
    if (index < 0 || index >= expressions.size()) { expressions.add(builder); } else { expressions.set(index, builder);}
     return (A)this;
  }
  public A addToExpressions(io.dekorate.helm.config.HelmExpression... items) {
    if (this.expressions == null) {this.expressions = new ArrayList();}
    for (HelmExpression item : items) {HelmExpressionBuilder builder = new HelmExpressionBuilder(item);_visitables.get("expressions").add(builder);this.expressions.add(builder);} return (A)this;
  }
  public A addAllToExpressions(Collection items) {
    if (this.expressions == null) {this.expressions = new ArrayList();}
    for (HelmExpression item : items) {HelmExpressionBuilder builder = new HelmExpressionBuilder(item);_visitables.get("expressions").add(builder);this.expressions.add(builder);} return (A)this;
  }
  public A removeFromExpressions(io.dekorate.helm.config.HelmExpression... items) {
    for (HelmExpression item : items) {HelmExpressionBuilder builder = new HelmExpressionBuilder(item);_visitables.get("expressions").remove(builder);if (this.expressions != null) {this.expressions.remove(builder);}} return (A)this;
  }
  public A removeAllFromExpressions(Collection items) {
    for (HelmExpression item : items) {HelmExpressionBuilder builder = new HelmExpressionBuilder(item);_visitables.get("expressions").remove(builder);if (this.expressions != null) {this.expressions.remove(builder);}} return (A)this;
  }
  public A removeMatchingFromExpressions(Predicate predicate) {
    if (expressions == null) return (A) this;
    final Iterator each = expressions.iterator();
    final List visitables = _visitables.get("expressions");
    while (each.hasNext()) {
      HelmExpressionBuilder builder = each.next();
      if (predicate.test(builder)) {
        visitables.remove(builder);
        each.remove();
      }
    }
    return (A)this;
  }
  public Boolean hasExpressions() {
    return expressions != null && !expressions.isEmpty();
  }
  public A addNewExpression(String path,String expression) {
    return (A)addToExpressions(new HelmExpression(path, expression));
  }
  public HelmChartConfigFluent.ExpressionsNested addNewExpression() {
    return new HelmChartConfigFluentImpl.ExpressionsNestedImpl();
  }
  public HelmChartConfigFluent.ExpressionsNested addNewExpressionLike(HelmExpression item) {
    return new HelmChartConfigFluentImpl.ExpressionsNestedImpl(-1, item);
  }
  public HelmChartConfigFluent.ExpressionsNested setNewExpressionLike(Integer index,HelmExpression item) {
    return new HelmChartConfigFluentImpl.ExpressionsNestedImpl(index, item);
  }
  public HelmChartConfigFluent.ExpressionsNested editExpression(Integer index) {
    if (expressions.size() <= index) throw new RuntimeException("Can't edit expressions. Index exceeds size.");
    return setNewExpressionLike(index, buildExpression(index));
  }
  public HelmChartConfigFluent.ExpressionsNested editFirstExpression() {
    if (expressions.size() == 0) throw new RuntimeException("Can't edit first expressions. The list is empty.");
    return setNewExpressionLike(0, buildExpression(0));
  }
  public HelmChartConfigFluent.ExpressionsNested editLastExpression() {
    int index = expressions.size() - 1;
    if (index < 0) throw new RuntimeException("Can't edit last expressions. The list is empty.");
    return setNewExpressionLike(index, buildExpression(index));
  }
  public HelmChartConfigFluent.ExpressionsNested editMatchingExpression(Predicate predicate) {
    int index = -1;
    for (int i=0;i extends MaintainerFluentImpl> implements HelmChartConfigFluent.MaintainersNested,Nested{
    MaintainersNestedImpl(Integer index,Maintainer item) {
      this.index = index;
      this.builder = new MaintainerBuilder(this, item);
    }
    MaintainersNestedImpl() {
      this.index = -1;
      this.builder = new MaintainerBuilder(this);
    }
    MaintainerBuilder builder;
    Integer index;
    public N and() {
      return (N) HelmChartConfigFluentImpl.this.setToMaintainers(index,builder.build());
    }
    public N endMaintainer() {
      return and();
    }
    
  }
  class DependenciesNestedImpl extends HelmDependencyFluentImpl> implements HelmChartConfigFluent.DependenciesNested,Nested{
    DependenciesNestedImpl(Integer index,HelmDependency item) {
      this.index = index;
      this.builder = new HelmDependencyBuilder(this, item);
    }
    DependenciesNestedImpl() {
      this.index = -1;
      this.builder = new HelmDependencyBuilder(this);
    }
    HelmDependencyBuilder builder;
    Integer index;
    public N and() {
      return (N) HelmChartConfigFluentImpl.this.setToDependencies(index,builder.build());
    }
    public N endDependency() {
      return and();
    }
    
  }
  class ValuesNestedImpl extends ValueReferenceFluentImpl> implements HelmChartConfigFluent.ValuesNested,Nested{
    ValuesNestedImpl(Integer index,ValueReference item) {
      this.index = index;
      this.builder = new ValueReferenceBuilder(this, item);
    }
    ValuesNestedImpl() {
      this.index = -1;
      this.builder = new ValueReferenceBuilder(this);
    }
    ValueReferenceBuilder builder;
    Integer index;
    public N and() {
      return (N) HelmChartConfigFluentImpl.this.setToValues(index,builder.build());
    }
    public N endValue() {
      return and();
    }
    
  }
  class ExpressionsNestedImpl extends HelmExpressionFluentImpl> implements HelmChartConfigFluent.ExpressionsNested,Nested{
    ExpressionsNestedImpl(Integer index,HelmExpression item) {
      this.index = index;
      this.builder = new HelmExpressionBuilder(this, item);
    }
    ExpressionsNestedImpl() {
      this.index = -1;
      this.builder = new HelmExpressionBuilder(this);
    }
    HelmExpressionBuilder builder;
    Integer index;
    public N and() {
      return (N) HelmChartConfigFluentImpl.this.setToExpressions(index,builder.build());
    }
    public N endExpression() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy