io.fabric8.kubernetes.api.model.flowcontrol.v1beta3.PriorityLevelConfigurationSpecFluent Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.flowcontrol.v1beta3;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Integer;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class PriorityLevelConfigurationSpecFluent> extends BaseFluent{
public PriorityLevelConfigurationSpecFluent() {
}
public PriorityLevelConfigurationSpecFluent(PriorityLevelConfigurationSpec instance) {
this.copyInstance(instance);
}
private ExemptPriorityLevelConfigurationBuilder exempt;
private LimitedPriorityLevelConfigurationBuilder limited;
private String type;
private Map additionalProperties;
protected void copyInstance(PriorityLevelConfigurationSpec instance) {
instance = (instance != null ? instance : new PriorityLevelConfigurationSpec());
if (instance != null) {
this.withExempt(instance.getExempt());
this.withLimited(instance.getLimited());
this.withType(instance.getType());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public ExemptPriorityLevelConfiguration buildExempt() {
return this.exempt != null ? this.exempt.build() : null;
}
public A withExempt(ExemptPriorityLevelConfiguration exempt) {
this._visitables.remove("exempt");
if (exempt != null) {
this.exempt = new ExemptPriorityLevelConfigurationBuilder(exempt);
this._visitables.get("exempt").add(this.exempt);
} else {
this.exempt = null;
this._visitables.get("exempt").remove(this.exempt);
}
return (A) this;
}
public boolean hasExempt() {
return this.exempt != null;
}
public A withNewExempt(Integer lendablePercent,Integer nominalConcurrencyShares) {
return (A)withExempt(new ExemptPriorityLevelConfiguration(lendablePercent, nominalConcurrencyShares));
}
public ExemptNested withNewExempt() {
return new ExemptNested(null);
}
public ExemptNested withNewExemptLike(ExemptPriorityLevelConfiguration item) {
return new ExemptNested(item);
}
public ExemptNested editExempt() {
return withNewExemptLike(java.util.Optional.ofNullable(buildExempt()).orElse(null));
}
public ExemptNested editOrNewExempt() {
return withNewExemptLike(java.util.Optional.ofNullable(buildExempt()).orElse(new ExemptPriorityLevelConfigurationBuilder().build()));
}
public ExemptNested editOrNewExemptLike(ExemptPriorityLevelConfiguration item) {
return withNewExemptLike(java.util.Optional.ofNullable(buildExempt()).orElse(item));
}
public LimitedPriorityLevelConfiguration buildLimited() {
return this.limited != null ? this.limited.build() : null;
}
public A withLimited(LimitedPriorityLevelConfiguration limited) {
this._visitables.remove("limited");
if (limited != null) {
this.limited = new LimitedPriorityLevelConfigurationBuilder(limited);
this._visitables.get("limited").add(this.limited);
} else {
this.limited = null;
this._visitables.get("limited").remove(this.limited);
}
return (A) this;
}
public boolean hasLimited() {
return this.limited != null;
}
public LimitedNested withNewLimited() {
return new LimitedNested(null);
}
public LimitedNested withNewLimitedLike(LimitedPriorityLevelConfiguration item) {
return new LimitedNested(item);
}
public LimitedNested editLimited() {
return withNewLimitedLike(java.util.Optional.ofNullable(buildLimited()).orElse(null));
}
public LimitedNested editOrNewLimited() {
return withNewLimitedLike(java.util.Optional.ofNullable(buildLimited()).orElse(new LimitedPriorityLevelConfigurationBuilder().build()));
}
public LimitedNested editOrNewLimitedLike(LimitedPriorityLevelConfiguration item) {
return withNewLimitedLike(java.util.Optional.ofNullable(buildLimited()).orElse(item));
}
public String getType() {
return this.type;
}
public A withType(String type) {
this.type = type;
return (A) this;
}
public boolean hasType() {
return this.type != 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;
PriorityLevelConfigurationSpecFluent that = (PriorityLevelConfigurationSpecFluent) o;
if (!java.util.Objects.equals(exempt, that.exempt)) return false;
if (!java.util.Objects.equals(limited, that.limited)) return false;
if (!java.util.Objects.equals(type, that.type)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(exempt, limited, type, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (exempt != null) { sb.append("exempt:"); sb.append(exempt + ","); }
if (limited != null) { sb.append("limited:"); sb.append(limited + ","); }
if (type != null) { sb.append("type:"); sb.append(type + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class ExemptNested extends ExemptPriorityLevelConfigurationFluent> implements Nested{
ExemptNested(ExemptPriorityLevelConfiguration item) {
this.builder = new ExemptPriorityLevelConfigurationBuilder(this, item);
}
ExemptPriorityLevelConfigurationBuilder builder;
public N and() {
return (N) PriorityLevelConfigurationSpecFluent.this.withExempt(builder.build());
}
public N endExempt() {
return and();
}
}
public class LimitedNested extends LimitedPriorityLevelConfigurationFluent> implements Nested{
LimitedNested(LimitedPriorityLevelConfiguration item) {
this.builder = new LimitedPriorityLevelConfigurationBuilder(this, item);
}
LimitedPriorityLevelConfigurationBuilder builder;
public N and() {
return (N) PriorityLevelConfigurationSpecFluent.this.withLimited(builder.build());
}
public N endLimited() {
return and();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy