io.fabric8.kubernetes.api.model.apps.RollingUpdateStatefulSetStrategyFluent Maven / Gradle / Ivy
The newest version!
package io.fabric8.kubernetes.api.model.apps;
import io.fabric8.kubernetes.api.model.IntOrString;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import io.fabric8.kubernetes.api.model.IntOrStringFluent;
import io.fabric8.kubernetes.api.model.IntOrStringBuilder;
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 RollingUpdateStatefulSetStrategyFluent> extends BaseFluent{
public RollingUpdateStatefulSetStrategyFluent() {
}
public RollingUpdateStatefulSetStrategyFluent(RollingUpdateStatefulSetStrategy instance) {
this.copyInstance(instance);
}
private IntOrStringBuilder maxUnavailable;
private Integer partition;
private Map additionalProperties;
protected void copyInstance(RollingUpdateStatefulSetStrategy instance) {
instance = (instance != null ? instance : new RollingUpdateStatefulSetStrategy());
if (instance != null) {
this.withMaxUnavailable(instance.getMaxUnavailable());
this.withPartition(instance.getPartition());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public IntOrString buildMaxUnavailable() {
return this.maxUnavailable != null ? this.maxUnavailable.build() : null;
}
public A withMaxUnavailable(IntOrString maxUnavailable) {
this._visitables.remove("maxUnavailable");
if (maxUnavailable != null) {
this.maxUnavailable = new IntOrStringBuilder(maxUnavailable);
this._visitables.get("maxUnavailable").add(this.maxUnavailable);
} else {
this.maxUnavailable = null;
this._visitables.get("maxUnavailable").remove(this.maxUnavailable);
}
return (A) this;
}
public boolean hasMaxUnavailable() {
return this.maxUnavailable != null;
}
public A withNewMaxUnavailable(Object value) {
return (A)withMaxUnavailable(new IntOrString(value));
}
public MaxUnavailableNested withNewMaxUnavailable() {
return new MaxUnavailableNested(null);
}
public MaxUnavailableNested withNewMaxUnavailableLike(IntOrString item) {
return new MaxUnavailableNested(item);
}
public MaxUnavailableNested editMaxUnavailable() {
return withNewMaxUnavailableLike(java.util.Optional.ofNullable(buildMaxUnavailable()).orElse(null));
}
public MaxUnavailableNested editOrNewMaxUnavailable() {
return withNewMaxUnavailableLike(java.util.Optional.ofNullable(buildMaxUnavailable()).orElse(new IntOrStringBuilder().build()));
}
public MaxUnavailableNested editOrNewMaxUnavailableLike(IntOrString item) {
return withNewMaxUnavailableLike(java.util.Optional.ofNullable(buildMaxUnavailable()).orElse(item));
}
public Integer getPartition() {
return this.partition;
}
public A withPartition(Integer partition) {
this.partition = partition;
return (A) this;
}
public boolean hasPartition() {
return this.partition != 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;
RollingUpdateStatefulSetStrategyFluent that = (RollingUpdateStatefulSetStrategyFluent) o;
if (!java.util.Objects.equals(maxUnavailable, that.maxUnavailable)) return false;
if (!java.util.Objects.equals(partition, that.partition)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(maxUnavailable, partition, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (maxUnavailable != null) { sb.append("maxUnavailable:"); sb.append(maxUnavailable + ","); }
if (partition != null) { sb.append("partition:"); sb.append(partition + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class MaxUnavailableNested extends IntOrStringFluent> implements Nested{
MaxUnavailableNested(IntOrString item) {
this.builder = new IntOrStringBuilder(this, item);
}
IntOrStringBuilder builder;
public N and() {
return (N) RollingUpdateStatefulSetStrategyFluent.this.withMaxUnavailable(builder.build());
}
public N endMaxUnavailable() {
return and();
}
}
}