annotations.me.snowdrop.applicationcrd.api.model.ApplicationStatusFluentImpl Maven / Gradle / Ivy
package me.snowdrop.applicationcrd.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.List;
import java.lang.Boolean;
import javax.validation.Valid;
import java.lang.Long;
import java.util.Collection;
import java.lang.Object;
public class ApplicationStatusFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements ApplicationStatusFluent{
private List components;
private List conditions;
private Long observedGeneration;
public ApplicationStatusFluentImpl(){
}
public ApplicationStatusFluentImpl(ApplicationStatus instance){
this.withComponents(instance.getComponents());
this.withConditions(instance.getConditions());
this.withObservedGeneration(instance.getObservedGeneration());
}
public A addToComponents(int index,ObjectStatus item){
if (this.components == null) {this.components = new ArrayList();}
ObjectStatusBuilder builder = new ObjectStatusBuilder(item);_visitables.get("components").add(index >= 0 ? index : _visitables.get("components").size(), builder);this.components.add(index >= 0 ? index : components.size(), builder); return (A)this;
}
public A setToComponents(int index,ObjectStatus item){
if (this.components == null) {this.components = new ArrayList();}
ObjectStatusBuilder builder = new ObjectStatusBuilder(item);
if (index < 0 || index >= _visitables.get("components").size()) { _visitables.get("components").add(builder); } else { _visitables.get("components").set(index, builder);}
if (index < 0 || index >= components.size()) { components.add(builder); } else { components.set(index, builder);}
return (A)this;
}
public A addToComponents(ObjectStatus... items){
if (this.components == null) {this.components = new ArrayList();}
for (ObjectStatus item : items) {ObjectStatusBuilder builder = new ObjectStatusBuilder(item);_visitables.get("components").add(builder);this.components.add(builder);} return (A)this;
}
public A addAllToComponents(Collection items){
if (this.components == null) {this.components = new ArrayList();}
for (ObjectStatus item : items) {ObjectStatusBuilder builder = new ObjectStatusBuilder(item);_visitables.get("components").add(builder);this.components.add(builder);} return (A)this;
}
public A removeFromComponents(ObjectStatus... items){
for (ObjectStatus item : items) {ObjectStatusBuilder builder = new ObjectStatusBuilder(item);_visitables.get("components").remove(builder);if (this.components != null) {this.components.remove(builder);}} return (A)this;
}
public A removeAllFromComponents(Collection items){
for (ObjectStatus item : items) {ObjectStatusBuilder builder = new ObjectStatusBuilder(item);_visitables.get("components").remove(builder);if (this.components != null) {this.components.remove(builder);}} return (A)this;
}
/**
* This method has been deprecated, please use method buildComponents instead.
* @return The buildable object.
*/
@Deprecated public List getComponents(){
return build(components);
}
public List buildComponents(){
return build(components);
}
public ObjectStatus buildComponent(int index){
return this.components.get(index).build();
}
public ObjectStatus buildFirstComponent(){
return this.components.get(0).build();
}
public ObjectStatus buildLastComponent(){
return this.components.get(components.size() - 1).build();
}
public ObjectStatus buildMatchingComponent(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (ObjectStatusBuilder item: components) { if(predicate.apply(item)){return item.build();} } return null;
}
public Boolean hasMatchingComponent(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (ObjectStatusBuilder item: components) { if(predicate.apply(item)){return true;} } return false;
}
public A withComponents(List components){
if (this.components != null) { _visitables.get("components").removeAll(this.components);}
if (components != null) {this.components = new ArrayList(); for (ObjectStatus item : components){this.addToComponents(item);}} else { this.components = null;} return (A) this;
}
public A withComponents(ObjectStatus... components){
if (this.components != null) {this.components.clear();}
if (components != null) {for (ObjectStatus item :components){ this.addToComponents(item);}} return (A) this;
}
public Boolean hasComponents(){
return components != null && !components.isEmpty();
}
public A addNewComponent(String group,String kind,String link,String name,String status){
return (A)addToComponents(new ObjectStatus(group, kind, link, name, status));
}
public ApplicationStatusFluent.ComponentsNested addNewComponent(){
return new ComponentsNestedImpl();
}
public ApplicationStatusFluent.ComponentsNested addNewComponentLike(ObjectStatus item){
return new ComponentsNestedImpl(-1, item);
}
public ApplicationStatusFluent.ComponentsNested setNewComponentLike(int index,ObjectStatus item){
return new ComponentsNestedImpl(index, item);
}
public ApplicationStatusFluent.ComponentsNested editComponent(int index){
if (components.size() <= index) throw new RuntimeException("Can't edit components. Index exceeds size.");
return setNewComponentLike(index, buildComponent(index));
}
public ApplicationStatusFluent.ComponentsNested editFirstComponent(){
if (components.size() == 0) throw new RuntimeException("Can't edit first components. The list is empty.");
return setNewComponentLike(0, buildComponent(0));
}
public ApplicationStatusFluent.ComponentsNested editLastComponent(){
int index = components.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last components. The list is empty.");
return setNewComponentLike(index, buildComponent(index));
}
public ApplicationStatusFluent.ComponentsNested editMatchingComponent(io.fabric8.kubernetes.api.builder.Predicate predicate){
int index = -1;
for (int i=0;i();}
ConditionBuilder builder = new ConditionBuilder(item);_visitables.get("conditions").add(index >= 0 ? index : _visitables.get("conditions").size(), builder);this.conditions.add(index >= 0 ? index : conditions.size(), builder); return (A)this;
}
public A setToConditions(int index,Condition item){
if (this.conditions == null) {this.conditions = new ArrayList();}
ConditionBuilder builder = new ConditionBuilder(item);
if (index < 0 || index >= _visitables.get("conditions").size()) { _visitables.get("conditions").add(builder); } else { _visitables.get("conditions").set(index, builder);}
if (index < 0 || index >= conditions.size()) { conditions.add(builder); } else { conditions.set(index, builder);}
return (A)this;
}
public A addToConditions(Condition... items){
if (this.conditions == null) {this.conditions = new ArrayList();}
for (Condition item : items) {ConditionBuilder builder = new ConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
}
public A addAllToConditions(Collection items){
if (this.conditions == null) {this.conditions = new ArrayList();}
for (Condition item : items) {ConditionBuilder builder = new ConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
}
public A removeFromConditions(Condition... items){
for (Condition item : items) {ConditionBuilder builder = new ConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
}
public A removeAllFromConditions(Collection items){
for (Condition item : items) {ConditionBuilder builder = new ConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
}
/**
* This method has been deprecated, please use method buildConditions instead.
* @return The buildable object.
*/
@Deprecated public List getConditions(){
return build(conditions);
}
public List buildConditions(){
return build(conditions);
}
public Condition buildCondition(int index){
return this.conditions.get(index).build();
}
public Condition buildFirstCondition(){
return this.conditions.get(0).build();
}
public Condition buildLastCondition(){
return this.conditions.get(conditions.size() - 1).build();
}
public Condition buildMatchingCondition(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (ConditionBuilder item: conditions) { if(predicate.apply(item)){return item.build();} } return null;
}
public Boolean hasMatchingCondition(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (ConditionBuilder item: conditions) { if(predicate.apply(item)){return true;} } return false;
}
public A withConditions(List conditions){
if (this.conditions != null) { _visitables.get("conditions").removeAll(this.conditions);}
if (conditions != null) {this.conditions = new ArrayList(); for (Condition item : conditions){this.addToConditions(item);}} else { this.conditions = null;} return (A) this;
}
public A withConditions(Condition... conditions){
if (this.conditions != null) {this.conditions.clear();}
if (conditions != null) {for (Condition item :conditions){ this.addToConditions(item);}} return (A) this;
}
public Boolean hasConditions(){
return conditions != null && !conditions.isEmpty();
}
public ApplicationStatusFluent.ConditionsNested addNewCondition(){
return new ConditionsNestedImpl();
}
public ApplicationStatusFluent.ConditionsNested addNewConditionLike(Condition item){
return new ConditionsNestedImpl(-1, item);
}
public ApplicationStatusFluent.ConditionsNested setNewConditionLike(int index,Condition item){
return new ConditionsNestedImpl(index, item);
}
public ApplicationStatusFluent.ConditionsNested editCondition(int index){
if (conditions.size() <= index) throw new RuntimeException("Can't edit conditions. Index exceeds size.");
return setNewConditionLike(index, buildCondition(index));
}
public ApplicationStatusFluent.ConditionsNested editFirstCondition(){
if (conditions.size() == 0) throw new RuntimeException("Can't edit first conditions. The list is empty.");
return setNewConditionLike(0, buildCondition(0));
}
public ApplicationStatusFluent.ConditionsNested editLastCondition(){
int index = conditions.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last conditions. The list is empty.");
return setNewConditionLike(index, buildCondition(index));
}
public ApplicationStatusFluent.ConditionsNested editMatchingCondition(io.fabric8.kubernetes.api.builder.Predicate predicate){
int index = -1;
for (int i=0;i extends ObjectStatusFluentImpl> implements ApplicationStatusFluent.ComponentsNested,io.fabric8.kubernetes.api.builder.Nested{
private final ObjectStatusBuilder builder;
private final int index;
ComponentsNestedImpl(int index,ObjectStatus item){
this.index = index;
this.builder = new ObjectStatusBuilder(this, item);
}
ComponentsNestedImpl(){
this.index = -1;
this.builder = new ObjectStatusBuilder(this);
}
public N and(){
return (N) ApplicationStatusFluentImpl.this.setToComponents(index, builder.build());
}
public N endComponent(){
return and();
}
}
public class ConditionsNestedImpl extends ConditionFluentImpl> implements ApplicationStatusFluent.ConditionsNested,io.fabric8.kubernetes.api.builder.Nested{
private final ConditionBuilder builder;
private final int index;
ConditionsNestedImpl(int index,Condition item){
this.index = index;
this.builder = new ConditionBuilder(this, item);
}
ConditionsNestedImpl(){
this.index = -1;
this.builder = new ConditionBuilder(this);
}
public N and(){
return (N) ApplicationStatusFluentImpl.this.setToConditions(index, builder.build());
}
public N endCondition(){
return and();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy