io.fabric8.openshift.api.model.machine.v1.ControlPlaneMachineSetStatusFluent Maven / Gradle / Ivy
package io.fabric8.openshift.api.model.machine.v1;
import io.fabric8.kubernetes.api.model.Condition;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Long;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class ControlPlaneMachineSetStatusFluent> extends BaseFluent{
public ControlPlaneMachineSetStatusFluent() {
}
public ControlPlaneMachineSetStatusFluent(ControlPlaneMachineSetStatus instance) {
this.copyInstance(instance);
}
private List conditions = new ArrayList();
private Long observedGeneration;
private Integer readyReplicas;
private Integer replicas;
private Integer unavailableReplicas;
private Integer updatedReplicas;
private Map additionalProperties;
protected void copyInstance(ControlPlaneMachineSetStatus instance) {
instance = (instance != null ? instance : new ControlPlaneMachineSetStatus());
if (instance != null) {
this.withConditions(instance.getConditions());
this.withObservedGeneration(instance.getObservedGeneration());
this.withReadyReplicas(instance.getReadyReplicas());
this.withReplicas(instance.getReplicas());
this.withUnavailableReplicas(instance.getUnavailableReplicas());
this.withUpdatedReplicas(instance.getUpdatedReplicas());
this.withConditions(instance.getConditions());
this.withObservedGeneration(instance.getObservedGeneration());
this.withReadyReplicas(instance.getReadyReplicas());
this.withReplicas(instance.getReplicas());
this.withUnavailableReplicas(instance.getUnavailableReplicas());
this.withUpdatedReplicas(instance.getUpdatedReplicas());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public A addToConditions(int index,Condition item) {
if (this.conditions == null) {this.conditions = new ArrayList();}
this.conditions.add(index, item);
return (A)this;
}
public A setToConditions(int index,Condition item) {
if (this.conditions == null) {this.conditions = new ArrayList();}
this.conditions.set(index, item); return (A)this;
}
public A addToConditions(io.fabric8.kubernetes.api.model.Condition... items) {
if (this.conditions == null) {this.conditions = new ArrayList();}
for (Condition item : items) {this.conditions.add(item);} return (A)this;
}
public A addAllToConditions(Collection items) {
if (this.conditions == null) {this.conditions = new ArrayList();}
for (Condition item : items) {this.conditions.add(item);} return (A)this;
}
public A removeFromConditions(io.fabric8.kubernetes.api.model.Condition... items) {
if (this.conditions == null) return (A)this;
for (Condition item : items) { this.conditions.remove(item);} return (A)this;
}
public A removeAllFromConditions(Collection items) {
if (this.conditions == null) return (A)this;
for (Condition item : items) { this.conditions.remove(item);} return (A)this;
}
public List getConditions() {
return this.conditions;
}
public Condition getCondition(int index) {
return this.conditions.get(index);
}
public Condition getFirstCondition() {
return this.conditions.get(0);
}
public Condition getLastCondition() {
return this.conditions.get(conditions.size() - 1);
}
public Condition getMatchingCondition(Predicate predicate) {
for (Condition item: conditions) { if(predicate.test(item)){ return item;} } return null;
}
public boolean hasMatchingCondition(Predicate predicate) {
for (Condition item: conditions) { if(predicate.test(item)){ return true;} } return false;
}
public A withConditions(List 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(io.fabric8.kubernetes.api.model.Condition... conditions) {
if (this.conditions != null) {this.conditions.clear(); _visitables.remove("conditions"); }
if (conditions != null) {for (Condition item :conditions){ this.addToConditions(item);}} return (A) this;
}
public boolean hasConditions() {
return conditions != null && !conditions.isEmpty();
}
public Long getObservedGeneration() {
return this.observedGeneration;
}
public A withObservedGeneration(Long observedGeneration) {
this.observedGeneration=observedGeneration; return (A) this;
}
public boolean hasObservedGeneration() {
return this.observedGeneration != null;
}
public Integer getReadyReplicas() {
return this.readyReplicas;
}
public A withReadyReplicas(Integer readyReplicas) {
this.readyReplicas=readyReplicas; return (A) this;
}
public boolean hasReadyReplicas() {
return this.readyReplicas != null;
}
public Integer getReplicas() {
return this.replicas;
}
public A withReplicas(Integer replicas) {
this.replicas=replicas; return (A) this;
}
public boolean hasReplicas() {
return this.replicas != null;
}
public Integer getUnavailableReplicas() {
return this.unavailableReplicas;
}
public A withUnavailableReplicas(Integer unavailableReplicas) {
this.unavailableReplicas=unavailableReplicas; return (A) this;
}
public boolean hasUnavailableReplicas() {
return this.unavailableReplicas != null;
}
public Integer getUpdatedReplicas() {
return this.updatedReplicas;
}
public A withUpdatedReplicas(Integer updatedReplicas) {
this.updatedReplicas=updatedReplicas; return (A) this;
}
public boolean hasUpdatedReplicas() {
return this.updatedReplicas != null;
}
public A addToAdditionalProperties(String key,Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(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(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 Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(Map additionalProperties) {
if (additionalProperties == null) { this.additionalProperties = null;} else {this.additionalProperties = new LinkedHashMap(additionalProperties);} return (A) this;
}
public boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ControlPlaneMachineSetStatusFluent that = (ControlPlaneMachineSetStatusFluent) o;
if (!java.util.Objects.equals(conditions, that.conditions)) return false;
if (!java.util.Objects.equals(observedGeneration, that.observedGeneration)) return false;
if (!java.util.Objects.equals(readyReplicas, that.readyReplicas)) return false;
if (!java.util.Objects.equals(replicas, that.replicas)) return false;
if (!java.util.Objects.equals(unavailableReplicas, that.unavailableReplicas)) return false;
if (!java.util.Objects.equals(updatedReplicas, that.updatedReplicas)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(conditions, observedGeneration, readyReplicas, replicas, unavailableReplicas, updatedReplicas, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (conditions != null && !conditions.isEmpty()) { sb.append("conditions:"); sb.append(conditions + ","); }
if (observedGeneration != null) { sb.append("observedGeneration:"); sb.append(observedGeneration + ","); }
if (readyReplicas != null) { sb.append("readyReplicas:"); sb.append(readyReplicas + ","); }
if (replicas != null) { sb.append("replicas:"); sb.append(replicas + ","); }
if (unavailableReplicas != null) { sb.append("unavailableReplicas:"); sb.append(unavailableReplicas + ","); }
if (updatedReplicas != null) { sb.append("updatedReplicas:"); sb.append(updatedReplicas + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy