io.fabric8.kubernetes.api.model.TopologySpreadConstraintFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.StringBuilder;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Integer;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class TopologySpreadConstraintFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements TopologySpreadConstraintFluent{
private LabelSelectorBuilder labelSelector;
private Integer maxSkew;
private String topologyKey;
private String whenUnsatisfiable;
public TopologySpreadConstraintFluentImpl(){
}
public TopologySpreadConstraintFluentImpl(TopologySpreadConstraint instance){
this.withLabelSelector(instance.getLabelSelector());
this.withMaxSkew(instance.getMaxSkew());
this.withTopologyKey(instance.getTopologyKey());
this.withWhenUnsatisfiable(instance.getWhenUnsatisfiable());
}
/**
* This method has been deprecated, please use method buildLabelSelector instead.
* @return The buildable object.
*/
@Deprecated public LabelSelector getLabelSelector(){
return this.labelSelector!=null?this.labelSelector.build():null;
}
public LabelSelector buildLabelSelector(){
return this.labelSelector!=null?this.labelSelector.build():null;
}
public A withLabelSelector(LabelSelector labelSelector){
_visitables.get("labelSelector").remove(this.labelSelector);
if (labelSelector!=null){ this.labelSelector= new LabelSelectorBuilder(labelSelector); _visitables.get("labelSelector").add(this.labelSelector);} return (A) this;
}
public Boolean hasLabelSelector(){
return this.labelSelector != null;
}
public TopologySpreadConstraintFluent.LabelSelectorNested withNewLabelSelector(){
return new LabelSelectorNestedImpl();
}
public TopologySpreadConstraintFluent.LabelSelectorNested withNewLabelSelectorLike(LabelSelector item){
return new LabelSelectorNestedImpl(item);
}
public TopologySpreadConstraintFluent.LabelSelectorNested editLabelSelector(){
return withNewLabelSelectorLike(getLabelSelector());
}
public TopologySpreadConstraintFluent.LabelSelectorNested editOrNewLabelSelector(){
return withNewLabelSelectorLike(getLabelSelector() != null ? getLabelSelector(): new LabelSelectorBuilder().build());
}
public TopologySpreadConstraintFluent.LabelSelectorNested editOrNewLabelSelectorLike(LabelSelector item){
return withNewLabelSelectorLike(getLabelSelector() != null ? getLabelSelector(): item);
}
public Integer getMaxSkew(){
return this.maxSkew;
}
public A withMaxSkew(Integer maxSkew){
this.maxSkew=maxSkew; return (A) this;
}
public Boolean hasMaxSkew(){
return this.maxSkew != null;
}
public String getTopologyKey(){
return this.topologyKey;
}
public A withTopologyKey(String topologyKey){
this.topologyKey=topologyKey; return (A) this;
}
public Boolean hasTopologyKey(){
return this.topologyKey != null;
}
public A withNewTopologyKey(String arg1){
return (A)withTopologyKey(new String(arg1));
}
public A withNewTopologyKey(StringBuilder arg1){
return (A)withTopologyKey(new String(arg1));
}
public A withNewTopologyKey(StringBuffer arg1){
return (A)withTopologyKey(new String(arg1));
}
public String getWhenUnsatisfiable(){
return this.whenUnsatisfiable;
}
public A withWhenUnsatisfiable(String whenUnsatisfiable){
this.whenUnsatisfiable=whenUnsatisfiable; return (A) this;
}
public Boolean hasWhenUnsatisfiable(){
return this.whenUnsatisfiable != null;
}
public A withNewWhenUnsatisfiable(String arg1){
return (A)withWhenUnsatisfiable(new String(arg1));
}
public A withNewWhenUnsatisfiable(StringBuilder arg1){
return (A)withWhenUnsatisfiable(new String(arg1));
}
public A withNewWhenUnsatisfiable(StringBuffer arg1){
return (A)withWhenUnsatisfiable(new String(arg1));
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TopologySpreadConstraintFluentImpl that = (TopologySpreadConstraintFluentImpl) o;
if (labelSelector != null ? !labelSelector.equals(that.labelSelector) :that.labelSelector != null) return false;
if (maxSkew != null ? !maxSkew.equals(that.maxSkew) :that.maxSkew != null) return false;
if (topologyKey != null ? !topologyKey.equals(that.topologyKey) :that.topologyKey != null) return false;
if (whenUnsatisfiable != null ? !whenUnsatisfiable.equals(that.whenUnsatisfiable) :that.whenUnsatisfiable != null) return false;
return true;
}
public class LabelSelectorNestedImpl extends LabelSelectorFluentImpl> implements TopologySpreadConstraintFluent.LabelSelectorNested,io.fabric8.kubernetes.api.builder.Nested{
private final LabelSelectorBuilder builder;
LabelSelectorNestedImpl(LabelSelector item){
this.builder = new LabelSelectorBuilder(this, item);
}
LabelSelectorNestedImpl(){
this.builder = new LabelSelectorBuilder(this);
}
public N and(){
return (N) TopologySpreadConstraintFluentImpl.this.withLabelSelector(builder.build());
}
public N endLabelSelector(){
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy