io.dekorate.helm.config.HelmChartConfigFluentImpl Maven / Gradle / Ivy
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.withHome(instance.getHome());
this.withSources(instance.getSources());
this.withVersion(instance.getVersion());
this.withDescription(instance.getDescription());
this.withKeywords(instance.getKeywords());
this.withMaintainers(instance.getMaintainers());
this.withIcon(instance.getIcon());
this.withApiVersion(instance.getApiVersion());
this.withCondition(instance.getCondition());
this.withTags(instance.getTags());
this.withAppVersion(instance.getAppVersion());
this.withDeprecated(instance.getDeprecated());
this.withAnnotations(instance.getAnnotations());
this.withKubeVersion(instance.getKubeVersion());
this.withDependencies(instance.getDependencies());
this.withType(instance.getType());
this.withValuesRootAlias(instance.getValuesRootAlias());
this.withCreateTarFile(instance.getCreateTarFile());
this.withExtension(instance.getExtension());
this.withTarFileClassifier(instance.getTarFileClassifier());
this.withNotes(instance.getNotes());
this.withInputFolder(instance.getInputFolder());
this.withOutputFolder(instance.getOutputFolder());
this.withValues(instance.getValues());
this.withExpressions(instance.getExpressions());
this.withAddIfStatements(instance.getAddIfStatements());
}
private Boolean enabled;
private String name;
private String home;
private List sources = new ArrayList();
private String version;
private String description;
private List keywords = new ArrayList();
private ArrayList maintainers = new ArrayList();
private String icon;
private String apiVersion;
private String condition;
private String tags;
private String appVersion;
private Boolean deprecated;
private ArrayList annotations = new ArrayList();
private String kubeVersion;
private ArrayList dependencies = new ArrayList();
private String type;
private String valuesRootAlias;
private Boolean createTarFile;
private String extension;
private String tarFileClassifier;
private String notes;
private String inputFolder;
private String outputFolder;
private ArrayList values = new ArrayList();
private ArrayList expressions = new ArrayList();
private ArrayList addIfStatements = 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 getHome() {
return this.home;
}
public A withHome(String home) {
this.home=home; return (A) this;
}
public Boolean hasHome() {
return this.home != null;
}
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 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 getDescription() {
return this.description;
}
public A withDescription(String description) {
this.description=description; return (A) this;
}
public Boolean hasDescription() {
return this.description != 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 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 extends Maintainer,?> 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 extends Maintainer,?> 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 : annotations) {
result[index++]=builder.build();
}
return result;
}
public Annotation[] buildAnnotations() {
int size = annotations != null ? annotations.size() : 0;
Annotation[] result = new Annotation[size];
if (size == 0) {
return result;
}
int index = 0;
for (VisitableBuilder extends Annotation,?> builder : annotations) {
result[index++]=builder.build();
}
return result;
}
public Annotation buildAnnotation(Integer index) {
return this.annotations.get(index).build();
}
public Annotation buildFirstAnnotation() {
return this.annotations.get(0).build();
}
public Annotation buildLastAnnotation() {
return this.annotations.get(annotations.size() - 1).build();
}
public Annotation buildMatchingAnnotation(Predicate predicate) {
for (AnnotationBuilder item: annotations) { if(predicate.test(item)){ return item.build();} } return null;
}
public Boolean hasMatchingAnnotation(Predicate predicate) {
for (AnnotationBuilder item: annotations) { if(predicate.test(item)){ return true;} } return false;
}
public A addToAnnotations(Integer index,Annotation item) {
if (this.annotations == null) {this.annotations = new ArrayList();}
AnnotationBuilder builder = new AnnotationBuilder(item);_visitables.get("annotations").add(index >= 0 ? index : _visitables.get("annotations").size(), builder);this.annotations.add(index >= 0 ? index : annotations.size(), builder); return (A)this;
}
public A setToAnnotations(Integer index,Annotation item) {
if (this.annotations == null) {this.annotations = new ArrayList();}
AnnotationBuilder builder = new AnnotationBuilder(item);
if (index < 0 || index >= _visitables.get("annotations").size()) { _visitables.get("annotations").add(builder); } else { _visitables.get("annotations").set(index, builder);}
if (index < 0 || index >= annotations.size()) { annotations.add(builder); } else { annotations.set(index, builder);}
return (A)this;
}
public A addToAnnotations(io.dekorate.helm.config.Annotation... items) {
if (this.annotations == null) {this.annotations = new ArrayList();}
for (Annotation item : items) {AnnotationBuilder builder = new AnnotationBuilder(item);_visitables.get("annotations").add(builder);this.annotations.add(builder);} return (A)this;
}
public A addAllToAnnotations(Collection items) {
if (this.annotations == null) {this.annotations = new ArrayList();}
for (Annotation item : items) {AnnotationBuilder builder = new AnnotationBuilder(item);_visitables.get("annotations").add(builder);this.annotations.add(builder);} return (A)this;
}
public A removeFromAnnotations(io.dekorate.helm.config.Annotation... items) {
for (Annotation item : items) {AnnotationBuilder builder = new AnnotationBuilder(item);_visitables.get("annotations").remove(builder);if (this.annotations != null) {this.annotations.remove(builder);}} return (A)this;
}
public A removeAllFromAnnotations(Collection items) {
for (Annotation item : items) {AnnotationBuilder builder = new AnnotationBuilder(item);_visitables.get("annotations").remove(builder);if (this.annotations != null) {this.annotations.remove(builder);}} return (A)this;
}
public A removeMatchingFromAnnotations(Predicate predicate) {
if (annotations == null) return (A) this;
final Iterator each = annotations.iterator();
final List visitables = _visitables.get("annotations");
while (each.hasNext()) {
AnnotationBuilder builder = each.next();
if (predicate.test(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
public Boolean hasAnnotations() {
return annotations != null && !annotations.isEmpty();
}
public A addNewAnnotation(String key,String value) {
return (A)addToAnnotations(new Annotation(key, value));
}
public HelmChartConfigFluent.AnnotationsNested addNewAnnotation() {
return new HelmChartConfigFluentImpl.AnnotationsNestedImpl();
}
public HelmChartConfigFluent.AnnotationsNested addNewAnnotationLike(Annotation item) {
return new HelmChartConfigFluentImpl.AnnotationsNestedImpl(-1, item);
}
public HelmChartConfigFluent.AnnotationsNested setNewAnnotationLike(Integer index,Annotation item) {
return new HelmChartConfigFluentImpl.AnnotationsNestedImpl(index, item);
}
public HelmChartConfigFluent.AnnotationsNested editAnnotation(Integer index) {
if (annotations.size() <= index) throw new RuntimeException("Can't edit annotations. Index exceeds size.");
return setNewAnnotationLike(index, buildAnnotation(index));
}
public HelmChartConfigFluent.AnnotationsNested editFirstAnnotation() {
if (annotations.size() == 0) throw new RuntimeException("Can't edit first annotations. The list is empty.");
return setNewAnnotationLike(0, buildAnnotation(0));
}
public HelmChartConfigFluent.AnnotationsNested editLastAnnotation() {
int index = annotations.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last annotations. The list is empty.");
return setNewAnnotationLike(index, buildAnnotation(index));
}
public HelmChartConfigFluent.AnnotationsNested editMatchingAnnotation(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 extends HelmDependency,?> 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 extends ValueReference,?> 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 extends HelmExpression,?> 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 builder : addIfStatements) {
result[index++]=builder.build();
}
return result;
}
public AddIfStatement[] buildAddIfStatements() {
int size = addIfStatements != null ? addIfStatements.size() : 0;
AddIfStatement[] result = new AddIfStatement[size];
if (size == 0) {
return result;
}
int index = 0;
for (VisitableBuilder extends AddIfStatement,?> builder : addIfStatements) {
result[index++]=builder.build();
}
return result;
}
public AddIfStatement buildAddIfStatement(Integer index) {
return this.addIfStatements.get(index).build();
}
public AddIfStatement buildFirstAddIfStatement() {
return this.addIfStatements.get(0).build();
}
public AddIfStatement buildLastAddIfStatement() {
return this.addIfStatements.get(addIfStatements.size() - 1).build();
}
public AddIfStatement buildMatchingAddIfStatement(Predicate predicate) {
for (AddIfStatementBuilder item: addIfStatements) { if(predicate.test(item)){ return item.build();} } return null;
}
public Boolean hasMatchingAddIfStatement(Predicate predicate) {
for (AddIfStatementBuilder item: addIfStatements) { if(predicate.test(item)){ return true;} } return false;
}
public A addToAddIfStatements(Integer index,AddIfStatement item) {
if (this.addIfStatements == null) {this.addIfStatements = new ArrayList();}
AddIfStatementBuilder builder = new AddIfStatementBuilder(item);_visitables.get("addIfStatements").add(index >= 0 ? index : _visitables.get("addIfStatements").size(), builder);this.addIfStatements.add(index >= 0 ? index : addIfStatements.size(), builder); return (A)this;
}
public A setToAddIfStatements(Integer index,AddIfStatement item) {
if (this.addIfStatements == null) {this.addIfStatements = new ArrayList();}
AddIfStatementBuilder builder = new AddIfStatementBuilder(item);
if (index < 0 || index >= _visitables.get("addIfStatements").size()) { _visitables.get("addIfStatements").add(builder); } else { _visitables.get("addIfStatements").set(index, builder);}
if (index < 0 || index >= addIfStatements.size()) { addIfStatements.add(builder); } else { addIfStatements.set(index, builder);}
return (A)this;
}
public A addToAddIfStatements(io.dekorate.helm.config.AddIfStatement... items) {
if (this.addIfStatements == null) {this.addIfStatements = new ArrayList();}
for (AddIfStatement item : items) {AddIfStatementBuilder builder = new AddIfStatementBuilder(item);_visitables.get("addIfStatements").add(builder);this.addIfStatements.add(builder);} return (A)this;
}
public A addAllToAddIfStatements(Collection items) {
if (this.addIfStatements == null) {this.addIfStatements = new ArrayList();}
for (AddIfStatement item : items) {AddIfStatementBuilder builder = new AddIfStatementBuilder(item);_visitables.get("addIfStatements").add(builder);this.addIfStatements.add(builder);} return (A)this;
}
public A removeFromAddIfStatements(io.dekorate.helm.config.AddIfStatement... items) {
for (AddIfStatement item : items) {AddIfStatementBuilder builder = new AddIfStatementBuilder(item);_visitables.get("addIfStatements").remove(builder);if (this.addIfStatements != null) {this.addIfStatements.remove(builder);}} return (A)this;
}
public A removeAllFromAddIfStatements(Collection items) {
for (AddIfStatement item : items) {AddIfStatementBuilder builder = new AddIfStatementBuilder(item);_visitables.get("addIfStatements").remove(builder);if (this.addIfStatements != null) {this.addIfStatements.remove(builder);}} return (A)this;
}
public A removeMatchingFromAddIfStatements(Predicate predicate) {
if (addIfStatements == null) return (A) this;
final Iterator each = addIfStatements.iterator();
final List visitables = _visitables.get("addIfStatements");
while (each.hasNext()) {
AddIfStatementBuilder builder = each.next();
if (predicate.test(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
public Boolean hasAddIfStatements() {
return addIfStatements != null && !addIfStatements.isEmpty();
}
public A addNewAddIfStatement(String property,String onResourceKind,String onResourceName,Boolean withDefaultValue) {
return (A)addToAddIfStatements(new AddIfStatement(property, onResourceKind, onResourceName, withDefaultValue));
}
public HelmChartConfigFluent.AddIfStatementsNested addNewAddIfStatement() {
return new HelmChartConfigFluentImpl.AddIfStatementsNestedImpl();
}
public HelmChartConfigFluent.AddIfStatementsNested addNewAddIfStatementLike(AddIfStatement item) {
return new HelmChartConfigFluentImpl.AddIfStatementsNestedImpl(-1, item);
}
public HelmChartConfigFluent.AddIfStatementsNested setNewAddIfStatementLike(Integer index,AddIfStatement item) {
return new HelmChartConfigFluentImpl.AddIfStatementsNestedImpl(index, item);
}
public HelmChartConfigFluent.AddIfStatementsNested editAddIfStatement(Integer index) {
if (addIfStatements.size() <= index) throw new RuntimeException("Can't edit addIfStatements. Index exceeds size.");
return setNewAddIfStatementLike(index, buildAddIfStatement(index));
}
public HelmChartConfigFluent.AddIfStatementsNested editFirstAddIfStatement() {
if (addIfStatements.size() == 0) throw new RuntimeException("Can't edit first addIfStatements. The list is empty.");
return setNewAddIfStatementLike(0, buildAddIfStatement(0));
}
public HelmChartConfigFluent.AddIfStatementsNested editLastAddIfStatement() {
int index = addIfStatements.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last addIfStatements. The list is empty.");
return setNewAddIfStatementLike(index, buildAddIfStatement(index));
}
public HelmChartConfigFluent.AddIfStatementsNested editMatchingAddIfStatement(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 AnnotationsNestedImpl extends AnnotationFluentImpl> implements HelmChartConfigFluent.AnnotationsNested,Nested{
AnnotationsNestedImpl(Integer index,Annotation item) {
this.index = index;
this.builder = new AnnotationBuilder(this, item);
}
AnnotationsNestedImpl() {
this.index = -1;
this.builder = new AnnotationBuilder(this);
}
AnnotationBuilder builder;
Integer index;
public N and() {
return (N) HelmChartConfigFluentImpl.this.setToAnnotations(index,builder.build());
}
public N endAnnotation() {
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();
}
}
class AddIfStatementsNestedImpl extends AddIfStatementFluentImpl> implements HelmChartConfigFluent.AddIfStatementsNested,Nested{
AddIfStatementsNestedImpl(Integer index,AddIfStatement item) {
this.index = index;
this.builder = new AddIfStatementBuilder(this, item);
}
AddIfStatementsNestedImpl() {
this.index = -1;
this.builder = new AddIfStatementBuilder(this);
}
AddIfStatementBuilder builder;
Integer index;
public N and() {
return (N) HelmChartConfigFluentImpl.this.setToAddIfStatements(index,builder.build());
}
public N endAddIfStatement() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy