io.fabric8.autoscaling.api.model.v1beta1.ContainerResourcePolicyFluent Maven / Gradle / Ivy
package io.fabric8.autoscaling.api.model.v1beta1;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.model.Quantity;
import java.lang.Object;
import java.lang.String;
import java.util.Map;
import java.util.LinkedHashMap;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class ContainerResourcePolicyFluent> extends BaseFluent{
public ContainerResourcePolicyFluent() {
}
public ContainerResourcePolicyFluent(ContainerResourcePolicy instance) {
this.copyInstance(instance);
}
private String containerName;
private Map maxAllowed;
private Map minAllowed;
private String mode;
private Map additionalProperties;
protected void copyInstance(ContainerResourcePolicy instance) {
instance = (instance != null ? instance : new ContainerResourcePolicy());
if (instance != null) {
this.withContainerName(instance.getContainerName());
this.withMaxAllowed(instance.getMaxAllowed());
this.withMinAllowed(instance.getMinAllowed());
this.withMode(instance.getMode());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public String getContainerName() {
return this.containerName;
}
public A withContainerName(String containerName) {
this.containerName = containerName;
return (A) this;
}
public boolean hasContainerName() {
return this.containerName != null;
}
public A addToMaxAllowed(String key,Quantity value) {
if(this.maxAllowed == null && key != null && value != null) { this.maxAllowed = new LinkedHashMap(); }
if(key != null && value != null) {this.maxAllowed.put(key, value);} return (A)this;
}
public A addToMaxAllowed(Map map) {
if(this.maxAllowed == null && map != null) { this.maxAllowed = new LinkedHashMap(); }
if(map != null) { this.maxAllowed.putAll(map);} return (A)this;
}
public A removeFromMaxAllowed(String key) {
if(this.maxAllowed == null) { return (A) this; }
if(key != null && this.maxAllowed != null) {this.maxAllowed.remove(key);} return (A)this;
}
public A removeFromMaxAllowed(Map map) {
if(this.maxAllowed == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.maxAllowed != null){this.maxAllowed.remove(key);}}} return (A)this;
}
public Map getMaxAllowed() {
return this.maxAllowed;
}
public A withMaxAllowed(Map maxAllowed) {
if (maxAllowed == null) {
this.maxAllowed = null;
} else {
this.maxAllowed = new LinkedHashMap(maxAllowed);
}
return (A) this;
}
public boolean hasMaxAllowed() {
return this.maxAllowed != null;
}
public A addToMinAllowed(String key,Quantity value) {
if(this.minAllowed == null && key != null && value != null) { this.minAllowed = new LinkedHashMap(); }
if(key != null && value != null) {this.minAllowed.put(key, value);} return (A)this;
}
public A addToMinAllowed(Map map) {
if(this.minAllowed == null && map != null) { this.minAllowed = new LinkedHashMap(); }
if(map != null) { this.minAllowed.putAll(map);} return (A)this;
}
public A removeFromMinAllowed(String key) {
if(this.minAllowed == null) { return (A) this; }
if(key != null && this.minAllowed != null) {this.minAllowed.remove(key);} return (A)this;
}
public A removeFromMinAllowed(Map map) {
if(this.minAllowed == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.minAllowed != null){this.minAllowed.remove(key);}}} return (A)this;
}
public Map getMinAllowed() {
return this.minAllowed;
}
public A withMinAllowed(Map minAllowed) {
if (minAllowed == null) {
this.minAllowed = null;
} else {
this.minAllowed = new LinkedHashMap(minAllowed);
}
return (A) this;
}
public boolean hasMinAllowed() {
return this.minAllowed != null;
}
public String getMode() {
return this.mode;
}
public A withMode(String mode) {
this.mode = mode;
return (A) this;
}
public boolean hasMode() {
return this.mode != 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;
ContainerResourcePolicyFluent that = (ContainerResourcePolicyFluent) o;
if (!java.util.Objects.equals(containerName, that.containerName)) return false;
if (!java.util.Objects.equals(maxAllowed, that.maxAllowed)) return false;
if (!java.util.Objects.equals(minAllowed, that.minAllowed)) return false;
if (!java.util.Objects.equals(mode, that.mode)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(containerName, maxAllowed, minAllowed, mode, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (containerName != null) { sb.append("containerName:"); sb.append(containerName + ","); }
if (maxAllowed != null && !maxAllowed.isEmpty()) { sb.append("maxAllowed:"); sb.append(maxAllowed + ","); }
if (minAllowed != null && !minAllowed.isEmpty()) { sb.append("minAllowed:"); sb.append(minAllowed + ","); }
if (mode != null) { sb.append("mode:"); sb.append(mode + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy