annotations.io.alauda.kubernetes.api.model.NodeSelectorBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class NodeSelectorBuilder extends NodeSelectorFluentImpl implements VisitableBuilder{
NodeSelectorFluent> fluent;
Boolean validationEnabled;
public NodeSelectorBuilder(){
this(true);
}
public NodeSelectorBuilder(Boolean validationEnabled){
this(new NodeSelector(), validationEnabled);
}
public NodeSelectorBuilder(NodeSelectorFluent> fluent){
this(fluent, true);
}
public NodeSelectorBuilder(NodeSelectorFluent> fluent,Boolean validationEnabled){
this(fluent, new NodeSelector(), validationEnabled);
}
public NodeSelectorBuilder(NodeSelectorFluent> fluent,NodeSelector instance){
this(fluent, instance, true);
}
public NodeSelectorBuilder(NodeSelectorFluent> fluent,NodeSelector instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withNodeSelectorTerms(instance.getNodeSelectorTerms());
this.validationEnabled = validationEnabled;
}
public NodeSelectorBuilder(NodeSelector instance){
this(instance,true);
}
public NodeSelectorBuilder(NodeSelector instance,Boolean validationEnabled){
this.fluent = this;
this.withNodeSelectorTerms(instance.getNodeSelectorTerms());
this.validationEnabled = validationEnabled;
}
public NodeSelector build(){
NodeSelector buildable = new NodeSelector(fluent.getNodeSelectorTerms());
io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
return buildable;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
NodeSelectorBuilder that = (NodeSelectorBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
}