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

io.dekorate.application.config.ApplicationConfigFluentImpl Maven / Gradle / Ivy

There is a newer version: 2.0.0.beta8
Show newest version
package io.dekorate.application.config;

import io.dekorate.deps.kubernetes.api.builder.VisitableBuilder;
import java.lang.StringBuilder;
import io.dekorate.deps.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.dekorate.deps.kubernetes.api.builder.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.StringBuffer;
import java.util.Collection;
import java.lang.Object;

public class ApplicationConfigFluentImpl> extends ConfigurationFluentImpl implements ApplicationConfigFluent{

    private String group = "";
    private String name = "";
    private String version = "";
    private List owners =  new ArrayList();
    private List maintainers =  new ArrayList();
    private List info =  new ArrayList();
    private List icons =  new ArrayList();
    private List links =  new ArrayList();
    private String notes = "";
    private List keywords = new ArrayList();

    public ApplicationConfigFluentImpl(){
    }
    public ApplicationConfigFluentImpl(ApplicationConfig instance){
            this.withProject(instance.getProject()); 
            this.withAttributes(instance.getAttributes()); 
            this.withGroup(instance.getGroup()); 
            this.withName(instance.getName()); 
            this.withVersion(instance.getVersion()); 
            this.withOwners(instance.getOwners()); 
            this.withMaintainers(instance.getMaintainers()); 
            this.withInfo(instance.getInfo()); 
            this.withIcons(instance.getIcons()); 
            this.withLinks(instance.getLinks()); 
            this.withNotes(instance.getNotes()); 
            this.withKeywords(instance.getKeywords()); 
    }

    public String getGroup(){
            return this.group;
    }

    public A withGroup(String group){
            this.group=group; return (A) this;
    }

    public Boolean hasGroup(){
            return this.group != null;
    }

    public A withNewGroup(String arg1){
            return (A)withGroup(new String(arg1));
    }

    public A withNewGroup(StringBuilder arg1){
            return (A)withGroup(new String(arg1));
    }

    public A withNewGroup(StringBuffer arg1){
            return (A)withGroup(new String(arg1));
    }

    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 A withNewName(String arg1){
            return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuilder arg1){
            return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuffer arg1){
            return (A)withName(new String(arg1));
    }

    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 A withNewVersion(String arg1){
            return (A)withVersion(new String(arg1));
    }

    public A withNewVersion(StringBuilder arg1){
            return (A)withVersion(new String(arg1));
    }

    public A withNewVersion(StringBuffer arg1){
            return (A)withVersion(new String(arg1));
    }

    public A withOwners(io.dekorate.application.config.Contact... owners){
            if (this.owners != null) {this.owners.clear();}
            if (owners != null) {for (io.dekorate.application.config.Contact item :owners){ this.addToOwners(item);}} return (A) this;
    }

    
/**
 * This method has been deprecated, please use method buildOwners instead.
 */
@Deprecated public io.dekorate.application.config.Contact[] getOwners(){
            int size = owners != null ? owners.size() : 0;
io.dekorate.application.config.Contact[] result = new io.dekorate.application.config.Contact[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : owners) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Contact[] buildOwners(){
            int size = owners != null ? owners.size() : 0;
io.dekorate.application.config.Contact[] result = new io.dekorate.application.config.Contact[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : owners) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Contact buildOwner(int index){
            return this.owners.get(index).build();
    }

    public io.dekorate.application.config.Contact buildFirstOwner(){
            return this.owners.get(0).build();
    }

    public io.dekorate.application.config.Contact buildLastOwner(){
            return this.owners.get(owners.size() - 1).build();
    }

    public io.dekorate.application.config.Contact buildMatchingOwner(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (ContactBuilder item: owners) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingOwner(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (ContactBuilder item: owners) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A addToOwners(int index,io.dekorate.application.config.Contact item){
            if (this.owners == null) {this.owners = new ArrayList();}
            io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("owners").add(index >= 0 ? index : _visitables.get("owners").size(), builder);this.owners.add(index >= 0 ? index : owners.size(), builder); return (A)this;
    }

    public A setToOwners(int index,io.dekorate.application.config.Contact item){
            if (this.owners == null) {this.owners = new ArrayList();}
            io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);
            if (index < 0 || index >= _visitables.get("owners").size()) { _visitables.get("owners").add(builder); } else { _visitables.get("owners").set(index, builder);}
            if (index < 0 || index >= owners.size()) { owners.add(builder); } else { owners.set(index, builder);}
             return (A)this;
    }

    public A addToOwners(io.dekorate.application.config.Contact... items){
            if (this.owners == null) {this.owners = new ArrayList();}
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("owners").add(builder);this.owners.add(builder);} return (A)this;
    }

    public A addAllToOwners(Collection items){
            if (this.owners == null) {this.owners = new ArrayList();}
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("owners").add(builder);this.owners.add(builder);} return (A)this;
    }

    public A removeFromOwners(io.dekorate.application.config.Contact... items){
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("owners").remove(builder);if (this.owners != null) {this.owners.remove(builder);}} return (A)this;
    }

    public A removeAllFromOwners(Collection items){
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("owners").remove(builder);if (this.owners != null) {this.owners.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromOwners(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            if (owners == null) return (A) this;
            final Iterator each = owners.iterator();
            final List visitables = _visitables.get("owners");
            while (each.hasNext()) {
              ContactBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    public Boolean hasOwners(){
            return owners != null && !owners.isEmpty();
    }

    public A addNewOwner(String name,String email,String url){
            return (A)addToOwners(new Contact(name, email, url));
    }

    public ApplicationConfigFluent.OwnersNested addNewOwner(){
            return new OwnersNestedImpl();
    }

    public ApplicationConfigFluent.OwnersNested addNewOwnerLike(io.dekorate.application.config.Contact item){
            return new OwnersNestedImpl(-1, item);
    }

    public ApplicationConfigFluent.OwnersNested setNewOwnerLike(int index,io.dekorate.application.config.Contact item){
            return new OwnersNestedImpl(index, item);
    }

    public ApplicationConfigFluent.OwnersNested editOwner(int index){
            if (owners.size() <= index) throw new RuntimeException("Can't edit owners. Index exceeds size.");
            return setNewOwnerLike(index, buildOwner(index));
    }

    public ApplicationConfigFluent.OwnersNested editFirstOwner(){
            if (owners.size() == 0) throw new RuntimeException("Can't edit first owners. The list is empty.");
            return setNewOwnerLike(0, buildOwner(0));
    }

    public ApplicationConfigFluent.OwnersNested editLastOwner(){
            int index = owners.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last owners. The list is empty.");
            return setNewOwnerLike(index, buildOwner(index));
    }

    public ApplicationConfigFluent.OwnersNested editMatchingOwner(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i builder : maintainers) {
    result[index++]=builder.build();
}
return result;

    }

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

    }

    public io.dekorate.application.config.Contact buildMaintainer(int index){
            return this.maintainers.get(index).build();
    }

    public io.dekorate.application.config.Contact buildFirstMaintainer(){
            return this.maintainers.get(0).build();
    }

    public io.dekorate.application.config.Contact buildLastMaintainer(){
            return this.maintainers.get(maintainers.size() - 1).build();
    }

    public io.dekorate.application.config.Contact buildMatchingMaintainer(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (ContactBuilder item: maintainers) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingMaintainer(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (ContactBuilder item: maintainers) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A addToMaintainers(int index,io.dekorate.application.config.Contact item){
            if (this.maintainers == null) {this.maintainers = new ArrayList();}
            io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(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(int index,io.dekorate.application.config.Contact item){
            if (this.maintainers == null) {this.maintainers = new ArrayList();}
            io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(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.application.config.Contact... items){
            if (this.maintainers == null) {this.maintainers = new ArrayList();}
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(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 (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("maintainers").add(builder);this.maintainers.add(builder);} return (A)this;
    }

    public A removeFromMaintainers(io.dekorate.application.config.Contact... items){
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("maintainers").remove(builder);if (this.maintainers != null) {this.maintainers.remove(builder);}} return (A)this;
    }

    public A removeAllFromMaintainers(Collection items){
            for (io.dekorate.application.config.Contact item : items) {io.dekorate.application.config.ContactBuilder builder = new io.dekorate.application.config.ContactBuilder(item);_visitables.get("maintainers").remove(builder);if (this.maintainers != null) {this.maintainers.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromMaintainers(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            if (maintainers == null) return (A) this;
            final Iterator each = maintainers.iterator();
            final List visitables = _visitables.get("maintainers");
            while (each.hasNext()) {
              ContactBuilder builder = each.next();
              if (predicate.apply(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 Contact(name, email, url));
    }

    public ApplicationConfigFluent.MaintainersNested addNewMaintainer(){
            return new MaintainersNestedImpl();
    }

    public ApplicationConfigFluent.MaintainersNested addNewMaintainerLike(io.dekorate.application.config.Contact item){
            return new MaintainersNestedImpl(-1, item);
    }

    public ApplicationConfigFluent.MaintainersNested setNewMaintainerLike(int index,io.dekorate.application.config.Contact item){
            return new MaintainersNestedImpl(index, item);
    }

    public ApplicationConfigFluent.MaintainersNested editMaintainer(int index){
            if (maintainers.size() <= index) throw new RuntimeException("Can't edit maintainers. Index exceeds size.");
            return setNewMaintainerLike(index, buildMaintainer(index));
    }

    public ApplicationConfigFluent.MaintainersNested editFirstMaintainer(){
            if (maintainers.size() == 0) throw new RuntimeException("Can't edit first maintainers. The list is empty.");
            return setNewMaintainerLike(0, buildMaintainer(0));
    }

    public ApplicationConfigFluent.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 ApplicationConfigFluent.MaintainersNested editMatchingMaintainer(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i builder : info) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Info[] buildInfo(){
            int size = info != null ? info.size() : 0;
io.dekorate.application.config.Info[] result = new io.dekorate.application.config.Info[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : info) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Info buildInfo(int index){
            return this.info.get(index).build();
    }

    public io.dekorate.application.config.Info buildFirstInfo(){
            return this.info.get(0).build();
    }

    public io.dekorate.application.config.Info buildLastInfo(){
            return this.info.get(info.size() - 1).build();
    }

    public io.dekorate.application.config.Info buildMatchingInfo(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (InfoBuilder item: info) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingInfo(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (InfoBuilder item: info) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A addToInfo(int index,io.dekorate.application.config.Info item){
            if (this.info == null) {this.info = new ArrayList();}
            io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);_visitables.get("info").add(index >= 0 ? index : _visitables.get("info").size(), builder);this.info.add(index >= 0 ? index : info.size(), builder); return (A)this;
    }

    public A setToInfo(int index,io.dekorate.application.config.Info item){
            if (this.info == null) {this.info = new ArrayList();}
            io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);
            if (index < 0 || index >= _visitables.get("info").size()) { _visitables.get("info").add(builder); } else { _visitables.get("info").set(index, builder);}
            if (index < 0 || index >= info.size()) { info.add(builder); } else { info.set(index, builder);}
             return (A)this;
    }

    public A addToInfo(io.dekorate.application.config.Info... items){
            if (this.info == null) {this.info = new ArrayList();}
            for (io.dekorate.application.config.Info item : items) {io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);_visitables.get("info").add(builder);this.info.add(builder);} return (A)this;
    }

    public A addAllToInfo(Collection items){
            if (this.info == null) {this.info = new ArrayList();}
            for (io.dekorate.application.config.Info item : items) {io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);_visitables.get("info").add(builder);this.info.add(builder);} return (A)this;
    }

    public A removeFromInfo(io.dekorate.application.config.Info... items){
            for (io.dekorate.application.config.Info item : items) {io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);_visitables.get("info").remove(builder);if (this.info != null) {this.info.remove(builder);}} return (A)this;
    }

    public A removeAllFromInfo(Collection items){
            for (io.dekorate.application.config.Info item : items) {io.dekorate.application.config.InfoBuilder builder = new io.dekorate.application.config.InfoBuilder(item);_visitables.get("info").remove(builder);if (this.info != null) {this.info.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromInfo(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            if (info == null) return (A) this;
            final Iterator each = info.iterator();
            final List visitables = _visitables.get("info");
            while (each.hasNext()) {
              InfoBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    public Boolean hasInfo(){
            return info != null && !info.isEmpty();
    }

    public A addNewInfo(String name,String value,String type,String valueFrom){
            return (A)addToInfo(new Info(name, value, type, valueFrom));
    }

    public ApplicationConfigFluent.InfoNested addNewInfo(){
            return new InfoNestedImpl();
    }

    public ApplicationConfigFluent.InfoNested addNewInfoLike(io.dekorate.application.config.Info item){
            return new InfoNestedImpl(-1, item);
    }

    public ApplicationConfigFluent.InfoNested setNewInfoLike(int index,io.dekorate.application.config.Info item){
            return new InfoNestedImpl(index, item);
    }

    public ApplicationConfigFluent.InfoNested editInfo(int index){
            if (info.size() <= index) throw new RuntimeException("Can't edit info. Index exceeds size.");
            return setNewInfoLike(index, buildInfo(index));
    }

    public ApplicationConfigFluent.InfoNested editFirstInfo(){
            if (info.size() == 0) throw new RuntimeException("Can't edit first info. The list is empty.");
            return setNewInfoLike(0, buildInfo(0));
    }

    public ApplicationConfigFluent.InfoNested editLastInfo(){
            int index = info.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last info. The list is empty.");
            return setNewInfoLike(index, buildInfo(index));
    }

    public ApplicationConfigFluent.InfoNested editMatchingInfo(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i builder : icons) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Icon[] buildIcons(){
            int size = icons != null ? icons.size() : 0;
io.dekorate.application.config.Icon[] result = new io.dekorate.application.config.Icon[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : icons) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Icon buildIcon(int index){
            return this.icons.get(index).build();
    }

    public io.dekorate.application.config.Icon buildFirstIcon(){
            return this.icons.get(0).build();
    }

    public io.dekorate.application.config.Icon buildLastIcon(){
            return this.icons.get(icons.size() - 1).build();
    }

    public io.dekorate.application.config.Icon buildMatchingIcon(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (IconBuilder item: icons) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingIcon(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (IconBuilder item: icons) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A addToIcons(int index,io.dekorate.application.config.Icon item){
            if (this.icons == null) {this.icons = new ArrayList();}
            io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);_visitables.get("icons").add(index >= 0 ? index : _visitables.get("icons").size(), builder);this.icons.add(index >= 0 ? index : icons.size(), builder); return (A)this;
    }

    public A setToIcons(int index,io.dekorate.application.config.Icon item){
            if (this.icons == null) {this.icons = new ArrayList();}
            io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);
            if (index < 0 || index >= _visitables.get("icons").size()) { _visitables.get("icons").add(builder); } else { _visitables.get("icons").set(index, builder);}
            if (index < 0 || index >= icons.size()) { icons.add(builder); } else { icons.set(index, builder);}
             return (A)this;
    }

    public A addToIcons(io.dekorate.application.config.Icon... items){
            if (this.icons == null) {this.icons = new ArrayList();}
            for (io.dekorate.application.config.Icon item : items) {io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);_visitables.get("icons").add(builder);this.icons.add(builder);} return (A)this;
    }

    public A addAllToIcons(Collection items){
            if (this.icons == null) {this.icons = new ArrayList();}
            for (io.dekorate.application.config.Icon item : items) {io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);_visitables.get("icons").add(builder);this.icons.add(builder);} return (A)this;
    }

    public A removeFromIcons(io.dekorate.application.config.Icon... items){
            for (io.dekorate.application.config.Icon item : items) {io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);_visitables.get("icons").remove(builder);if (this.icons != null) {this.icons.remove(builder);}} return (A)this;
    }

    public A removeAllFromIcons(Collection items){
            for (io.dekorate.application.config.Icon item : items) {io.dekorate.application.config.IconBuilder builder = new io.dekorate.application.config.IconBuilder(item);_visitables.get("icons").remove(builder);if (this.icons != null) {this.icons.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromIcons(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            if (icons == null) return (A) this;
            final Iterator each = icons.iterator();
            final List visitables = _visitables.get("icons");
            while (each.hasNext()) {
              IconBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    public Boolean hasIcons(){
            return icons != null && !icons.isEmpty();
    }

    public A addNewIcon(String type,String src,String size){
            return (A)addToIcons(new Icon(type, src, size));
    }

    public ApplicationConfigFluent.IconsNested addNewIcon(){
            return new IconsNestedImpl();
    }

    public ApplicationConfigFluent.IconsNested addNewIconLike(io.dekorate.application.config.Icon item){
            return new IconsNestedImpl(-1, item);
    }

    public ApplicationConfigFluent.IconsNested setNewIconLike(int index,io.dekorate.application.config.Icon item){
            return new IconsNestedImpl(index, item);
    }

    public ApplicationConfigFluent.IconsNested editIcon(int index){
            if (icons.size() <= index) throw new RuntimeException("Can't edit icons. Index exceeds size.");
            return setNewIconLike(index, buildIcon(index));
    }

    public ApplicationConfigFluent.IconsNested editFirstIcon(){
            if (icons.size() == 0) throw new RuntimeException("Can't edit first icons. The list is empty.");
            return setNewIconLike(0, buildIcon(0));
    }

    public ApplicationConfigFluent.IconsNested editLastIcon(){
            int index = icons.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last icons. The list is empty.");
            return setNewIconLike(index, buildIcon(index));
    }

    public ApplicationConfigFluent.IconsNested editMatchingIcon(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i builder : links) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Link[] buildLinks(){
            int size = links != null ? links.size() : 0;
io.dekorate.application.config.Link[] result = new io.dekorate.application.config.Link[size];
if (size == 0) {
   return result;
}
int index = 0;
for (VisitableBuilder builder : links) {
    result[index++]=builder.build();
}
return result;

    }

    public io.dekorate.application.config.Link buildLink(int index){
            return this.links.get(index).build();
    }

    public io.dekorate.application.config.Link buildFirstLink(){
            return this.links.get(0).build();
    }

    public io.dekorate.application.config.Link buildLastLink(){
            return this.links.get(links.size() - 1).build();
    }

    public io.dekorate.application.config.Link buildMatchingLink(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (LinkBuilder item: links) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingLink(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            for (LinkBuilder item: links) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A addToLinks(int index,io.dekorate.application.config.Link item){
            if (this.links == null) {this.links = new ArrayList();}
            io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);_visitables.get("links").add(index >= 0 ? index : _visitables.get("links").size(), builder);this.links.add(index >= 0 ? index : links.size(), builder); return (A)this;
    }

    public A setToLinks(int index,io.dekorate.application.config.Link item){
            if (this.links == null) {this.links = new ArrayList();}
            io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);
            if (index < 0 || index >= _visitables.get("links").size()) { _visitables.get("links").add(builder); } else { _visitables.get("links").set(index, builder);}
            if (index < 0 || index >= links.size()) { links.add(builder); } else { links.set(index, builder);}
             return (A)this;
    }

    public A addToLinks(io.dekorate.application.config.Link... items){
            if (this.links == null) {this.links = new ArrayList();}
            for (io.dekorate.application.config.Link item : items) {io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);_visitables.get("links").add(builder);this.links.add(builder);} return (A)this;
    }

    public A addAllToLinks(Collection items){
            if (this.links == null) {this.links = new ArrayList();}
            for (io.dekorate.application.config.Link item : items) {io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);_visitables.get("links").add(builder);this.links.add(builder);} return (A)this;
    }

    public A removeFromLinks(io.dekorate.application.config.Link... items){
            for (io.dekorate.application.config.Link item : items) {io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);_visitables.get("links").remove(builder);if (this.links != null) {this.links.remove(builder);}} return (A)this;
    }

    public A removeAllFromLinks(Collection items){
            for (io.dekorate.application.config.Link item : items) {io.dekorate.application.config.LinkBuilder builder = new io.dekorate.application.config.LinkBuilder(item);_visitables.get("links").remove(builder);if (this.links != null) {this.links.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromLinks(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            if (links == null) return (A) this;
            final Iterator each = links.iterator();
            final List visitables = _visitables.get("links");
            while (each.hasNext()) {
              LinkBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    public Boolean hasLinks(){
            return links != null && !links.isEmpty();
    }

    public A addNewLink(String description,String url){
            return (A)addToLinks(new Link(description, url));
    }

    public ApplicationConfigFluent.LinksNested addNewLink(){
            return new LinksNestedImpl();
    }

    public ApplicationConfigFluent.LinksNested addNewLinkLike(io.dekorate.application.config.Link item){
            return new LinksNestedImpl(-1, item);
    }

    public ApplicationConfigFluent.LinksNested setNewLinkLike(int index,io.dekorate.application.config.Link item){
            return new LinksNestedImpl(index, item);
    }

    public ApplicationConfigFluent.LinksNested editLink(int index){
            if (links.size() <= index) throw new RuntimeException("Can't edit links. Index exceeds size.");
            return setNewLinkLike(index, buildLink(index));
    }

    public ApplicationConfigFluent.LinksNested editFirstLink(){
            if (links.size() == 0) throw new RuntimeException("Can't edit first links. The list is empty.");
            return setNewLinkLike(0, buildLink(0));
    }

    public ApplicationConfigFluent.LinksNested editLastLink(){
            int index = links.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last links. The list is empty.");
            return setNewLinkLike(index, buildLink(index));
    }

    public ApplicationConfigFluent.LinksNested editMatchingLink(io.dekorate.deps.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i();}
            this.keywords.add(index, item);
            return (A)this;
    }

    public A setToKeywords(int index,String item){
            if (this.keywords == null) {this.keywords = new ArrayList();}
            this.keywords.set(index, item); return (A)this;
    }

    public A addToKeywords(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(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 addNewKeyword(String arg1){
            return (A)addToKeywords(new String(arg1));
    }

    public A addNewKeyword(StringBuilder arg1){
            return (A)addToKeywords(new String(arg1));
    }

    public A addNewKeyword(StringBuffer arg1){
            return (A)addToKeywords(new String(arg1));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            ApplicationConfigFluentImpl that = (ApplicationConfigFluentImpl) o;
            if (group != null ? !group.equals(that.group) :that.group != null) return false;
            if (name != null ? !name.equals(that.name) :that.name != null) return false;
            if (version != null ? !version.equals(that.version) :that.version != null) return false;
            if (owners != null ? !owners.equals(that.owners) :that.owners != null) return false;
            if (maintainers != null ? !maintainers.equals(that.maintainers) :that.maintainers != null) return false;
            if (info != null ? !info.equals(that.info) :that.info != null) return false;
            if (icons != null ? !icons.equals(that.icons) :that.icons != null) return false;
            if (links != null ? !links.equals(that.links) :that.links != null) return false;
            if (notes != null ? !notes.equals(that.notes) :that.notes != null) return false;
            if (keywords != null ? !keywords.equals(that.keywords) :that.keywords != null) return false;
            return true;
    }


    public class OwnersNestedImpl extends ContactFluentImpl> implements ApplicationConfigFluent.OwnersNested,io.dekorate.deps.kubernetes.api.builder.Nested{

            private final ContactBuilder builder;
        private final int index;
    
            OwnersNestedImpl(int index,io.dekorate.application.config.Contact item){
                    this.index = index;
                    this.builder = new ContactBuilder(this, item);
            }
            OwnersNestedImpl(){
                    this.index = -1;
                    this.builder = new ContactBuilder(this);
            }
    
    public N and(){
            return (N) ApplicationConfigFluentImpl.this.setToOwners(index,builder.build());
    }
    public N endOwner(){
            return and();
    }

}
    public class MaintainersNestedImpl extends ContactFluentImpl> implements ApplicationConfigFluent.MaintainersNested,io.dekorate.deps.kubernetes.api.builder.Nested{

            private final ContactBuilder builder;
        private final int index;
    
            MaintainersNestedImpl(int index,io.dekorate.application.config.Contact item){
                    this.index = index;
                    this.builder = new ContactBuilder(this, item);
            }
            MaintainersNestedImpl(){
                    this.index = -1;
                    this.builder = new ContactBuilder(this);
            }
    
    public N and(){
            return (N) ApplicationConfigFluentImpl.this.setToMaintainers(index,builder.build());
    }
    public N endMaintainer(){
            return and();
    }

}
    public class InfoNestedImpl extends InfoFluentImpl> implements ApplicationConfigFluent.InfoNested,io.dekorate.deps.kubernetes.api.builder.Nested{

            private final InfoBuilder builder;
        private final int index;
    
            InfoNestedImpl(int index,io.dekorate.application.config.Info item){
                    this.index = index;
                    this.builder = new InfoBuilder(this, item);
            }
            InfoNestedImpl(){
                    this.index = -1;
                    this.builder = new InfoBuilder(this);
            }
    
    public N and(){
            return (N) ApplicationConfigFluentImpl.this.setToInfo(index,builder.build());
    }
    public N endInfo(){
            return and();
    }

}
    public class IconsNestedImpl extends IconFluentImpl> implements ApplicationConfigFluent.IconsNested,io.dekorate.deps.kubernetes.api.builder.Nested{

            private final IconBuilder builder;
        private final int index;
    
            IconsNestedImpl(int index,io.dekorate.application.config.Icon item){
                    this.index = index;
                    this.builder = new IconBuilder(this, item);
            }
            IconsNestedImpl(){
                    this.index = -1;
                    this.builder = new IconBuilder(this);
            }
    
    public N and(){
            return (N) ApplicationConfigFluentImpl.this.setToIcons(index,builder.build());
    }
    public N endIcon(){
            return and();
    }

}
    public class LinksNestedImpl extends LinkFluentImpl> implements ApplicationConfigFluent.LinksNested,io.dekorate.deps.kubernetes.api.builder.Nested{

            private final LinkBuilder builder;
        private final int index;
    
            LinksNestedImpl(int index,io.dekorate.application.config.Link item){
                    this.index = index;
                    this.builder = new LinkBuilder(this, item);
            }
            LinksNestedImpl(){
                    this.index = -1;
                    this.builder = new LinkBuilder(this);
            }
    
    public N and(){
            return (N) ApplicationConfigFluentImpl.this.setToLinks(index,builder.build());
    }
    public N endLink(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy