io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.flowcontrol.v1beta1;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;
/**
* Generated
*/
public class PriorityLevelConfigurationStatusFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent{
public PriorityLevelConfigurationStatusFluentImpl() {
}
public PriorityLevelConfigurationStatusFluentImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatus instance) {
this.withConditions(instance.getConditions());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private java.util.List conditions = new java.util.ArrayList();
private java.util.Map additionalProperties;
public A addToConditions(java.lang.Integer index,io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item) {
if (this.conditions == null) {this.conditions = new java.util.ArrayList();}
io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(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(java.lang.Integer index,io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item) {
if (this.conditions == null) {this.conditions = new java.util.ArrayList();}
io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(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(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition... items) {
if (this.conditions == null) {this.conditions = new java.util.ArrayList();}
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item : items) {io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
}
public A addAllToConditions(java.util.Collection items) {
if (this.conditions == null) {this.conditions = new java.util.ArrayList();}
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item : items) {io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(item);_visitables.get("conditions").add(builder);this.conditions.add(builder);} return (A)this;
}
public A removeFromConditions(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition... items) {
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item : items) {io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
}
public A removeAllFromConditions(java.util.Collection items) {
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item : items) {io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(item);_visitables.get("conditions").remove(builder);if (this.conditions != null) {this.conditions.remove(builder);}} return (A)this;
}
public A removeMatchingFromConditions(java.util.function.Predicate predicate) {
if (conditions == null) return (A) this;
final Iterator each = conditions.iterator();
final List visitables = _visitables.get("conditions");
while (each.hasNext()) {
io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder = each.next();
if (predicate.test(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
/**
* This method has been deprecated, please use method buildConditions instead.
* @return The buildable object.
*/
@java.lang.Deprecated
public java.util.List getConditions() {
return build(conditions);
}
public java.util.List buildConditions() {
return build(conditions);
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition buildCondition(java.lang.Integer index) {
return this.conditions.get(index).build();
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition buildFirstCondition() {
return this.conditions.get(0).build();
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition buildLastCondition() {
return this.conditions.get(conditions.size() - 1).build();
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition buildMatchingCondition(java.util.function.Predicate predicate) {
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder item: conditions) { if(predicate.test(item)){ return item.build();} } return null;
}
public java.lang.Boolean hasMatchingCondition(java.util.function.Predicate predicate) {
for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder item: conditions) { if(predicate.test(item)){ return true;} } return false;
}
public A withConditions(java.util.List conditions) {
if (this.conditions != null) { _visitables.get("conditions").removeAll(this.conditions);}
if (conditions != null) {this.conditions = new java.util.ArrayList(); for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item : conditions){this.addToConditions(item);}} else { this.conditions = null;} return (A) this;
}
public A withConditions(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition... conditions) {
if (this.conditions != null) {this.conditions.clear();}
if (conditions != null) {for (io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item :conditions){ this.addToConditions(item);}} return (A) this;
}
public java.lang.Boolean hasConditions() {
return conditions != null && !conditions.isEmpty();
}
public A addNewCondition(java.lang.String lastTransitionTime,java.lang.String message,java.lang.String reason,java.lang.String status,java.lang.String type) {
return (A)addToConditions(new PriorityLevelConfigurationCondition(lastTransitionTime, message, reason, status, type));
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested addNewCondition() {
return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluentImpl.ConditionsNestedImpl();
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested addNewConditionLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item) {
return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluentImpl.ConditionsNestedImpl(-1, item);
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested setNewConditionLike(java.lang.Integer index,io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item) {
return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluentImpl.ConditionsNestedImpl(index, item);
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested editCondition(java.lang.Integer index) {
if (conditions.size() <= index) throw new RuntimeException("Can't edit conditions. Index exceeds size.");
return setNewConditionLike(index, buildCondition(index));
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested editFirstCondition() {
if (conditions.size() == 0) throw new RuntimeException("Can't edit first conditions. The list is empty.");
return setNewConditionLike(0, buildCondition(0));
}
public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.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 io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested editMatchingCondition(java.util.function.Predicate predicate) {
int index = -1;
for (int i=0;i(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(java.util.Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(java.lang.String key) {
if(this.additionalProperties == null) { return (A) this; }
if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
}
public A removeFromAdditionalProperties(java.util.Map map) {
if(this.additionalProperties == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
}
public java.util.Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(java.util.Map additionalProperties) {
if (additionalProperties == null) { this.additionalProperties = null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
}
public java.lang.Boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(java.lang.Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PriorityLevelConfigurationStatusFluentImpl that = (PriorityLevelConfigurationStatusFluentImpl) o;
if (conditions != null ? !conditions.equals(that.conditions) :that.conditions != null) return false;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(conditions, additionalProperties, super.hashCode());
}
public class ConditionsNestedImpl extends io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionFluentImpl> implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationStatusFluent.ConditionsNested,io.fabric8.kubernetes.api.builder.Nested{
ConditionsNestedImpl(java.lang.Integer index,io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationCondition item) {
this.index = index;
this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(this, item);
}
ConditionsNestedImpl() {
this.index = -1;
this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder(this);
}
io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.PriorityLevelConfigurationConditionBuilder builder;
java.lang.Integer index;
public N and() {
return (N) PriorityLevelConfigurationStatusFluentImpl.this.setToConditions(index,builder.build());
}
public N endCondition() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy