io.alauda.kubernetes.api.model.WeightedPodAffinityTermFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.Integer;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class WeightedPodAffinityTermFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements WeightedPodAffinityTermFluent{
private PodAffinityTermBuilder podAffinityTerm;
private Integer weight;
public WeightedPodAffinityTermFluentImpl(){
}
public WeightedPodAffinityTermFluentImpl(WeightedPodAffinityTerm instance){
this.withPodAffinityTerm(instance.getPodAffinityTerm());
this.withWeight(instance.getWeight());
}
/**
* This method has been deprecated, please use method buildPodAffinityTerm instead.
*/
@Deprecated public PodAffinityTerm getPodAffinityTerm(){
return this.podAffinityTerm!=null?this.podAffinityTerm.build():null;
}
public PodAffinityTerm buildPodAffinityTerm(){
return this.podAffinityTerm!=null?this.podAffinityTerm.build():null;
}
public A withPodAffinityTerm(PodAffinityTerm podAffinityTerm){
_visitables.remove(this.podAffinityTerm);
if (podAffinityTerm!=null){ this.podAffinityTerm= new PodAffinityTermBuilder(podAffinityTerm); _visitables.add(this.podAffinityTerm);} return (A) this;
}
public Boolean hasPodAffinityTerm(){
return this.podAffinityTerm!=null;
}
public WeightedPodAffinityTermFluent.PodAffinityTermNested withNewPodAffinityTerm(){
return new PodAffinityTermNestedImpl();
}
public WeightedPodAffinityTermFluent.PodAffinityTermNested withNewPodAffinityTermLike(PodAffinityTerm item){
return new PodAffinityTermNestedImpl(item);
}
public WeightedPodAffinityTermFluent.PodAffinityTermNested editPodAffinityTerm(){
return withNewPodAffinityTermLike(getPodAffinityTerm());
}
public WeightedPodAffinityTermFluent.PodAffinityTermNested editOrNewPodAffinityTerm(){
return withNewPodAffinityTermLike(getPodAffinityTerm() != null ? getPodAffinityTerm(): new PodAffinityTermBuilder().build());
}
public WeightedPodAffinityTermFluent.PodAffinityTermNested editOrNewPodAffinityTermLike(PodAffinityTerm item){
return withNewPodAffinityTermLike(getPodAffinityTerm() != null ? getPodAffinityTerm(): item);
}
public Integer getWeight(){
return this.weight;
}
public A withWeight(Integer weight){
this.weight=weight; return (A) this;
}
public Boolean hasWeight(){
return this.weight!=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;
WeightedPodAffinityTermFluentImpl that = (WeightedPodAffinityTermFluentImpl) o;
if (podAffinityTerm != null ? !podAffinityTerm.equals(that.podAffinityTerm) :that.podAffinityTerm != null) return false;
if (weight != null ? !weight.equals(that.weight) :that.weight != null) return false;
return true;
}
public class PodAffinityTermNestedImpl extends PodAffinityTermFluentImpl> implements WeightedPodAffinityTermFluent.PodAffinityTermNested,io.alauda.kubernetes.api.builder.Nested{
private final PodAffinityTermBuilder builder;
PodAffinityTermNestedImpl(PodAffinityTerm item){
this.builder = new PodAffinityTermBuilder(this, item);
}
PodAffinityTermNestedImpl(){
this.builder = new PodAffinityTermBuilder(this);
}
public N and(){
return (N) WeightedPodAffinityTermFluentImpl.this.withPodAffinityTerm(builder.build());
}
public N endPodAffinityTerm(){
return and();
}
}
}