annotations.io.alauda.kubernetes.api.model.PreferredSchedulingTermFluentImpl 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 PreferredSchedulingTermFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PreferredSchedulingTermFluent{
private NodeSelectorTermBuilder preference;
private Integer weight;
public PreferredSchedulingTermFluentImpl(){
}
public PreferredSchedulingTermFluentImpl(PreferredSchedulingTerm instance){
this.withPreference(instance.getPreference());
this.withWeight(instance.getWeight());
}
/**
* This method has been deprecated, please use method buildPreference instead.
*/
@Deprecated public NodeSelectorTerm getPreference(){
return this.preference!=null?this.preference.build():null;
}
public NodeSelectorTerm buildPreference(){
return this.preference!=null?this.preference.build():null;
}
public A withPreference(NodeSelectorTerm preference){
_visitables.remove(this.preference);
if (preference!=null){ this.preference= new NodeSelectorTermBuilder(preference); _visitables.add(this.preference);} return (A) this;
}
public Boolean hasPreference(){
return this.preference!=null;
}
public PreferredSchedulingTermFluent.PreferenceNested withNewPreference(){
return new PreferenceNestedImpl();
}
public PreferredSchedulingTermFluent.PreferenceNested withNewPreferenceLike(NodeSelectorTerm item){
return new PreferenceNestedImpl(item);
}
public PreferredSchedulingTermFluent.PreferenceNested editPreference(){
return withNewPreferenceLike(getPreference());
}
public PreferredSchedulingTermFluent.PreferenceNested editOrNewPreference(){
return withNewPreferenceLike(getPreference() != null ? getPreference(): new NodeSelectorTermBuilder().build());
}
public PreferredSchedulingTermFluent.PreferenceNested editOrNewPreferenceLike(NodeSelectorTerm item){
return withNewPreferenceLike(getPreference() != null ? getPreference(): 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;
PreferredSchedulingTermFluentImpl that = (PreferredSchedulingTermFluentImpl) o;
if (preference != null ? !preference.equals(that.preference) :that.preference != null) return false;
if (weight != null ? !weight.equals(that.weight) :that.weight != null) return false;
return true;
}
public class PreferenceNestedImpl extends NodeSelectorTermFluentImpl> implements PreferredSchedulingTermFluent.PreferenceNested,io.alauda.kubernetes.api.builder.Nested{
private final NodeSelectorTermBuilder builder;
PreferenceNestedImpl(NodeSelectorTerm item){
this.builder = new NodeSelectorTermBuilder(this, item);
}
PreferenceNestedImpl(){
this.builder = new NodeSelectorTermBuilder(this);
}
public N and(){
return (N) PreferredSchedulingTermFluentImpl.this.withPreference(builder.build());
}
public N endPreference(){
return and();
}
}
}