io.alauda.kubernetes.api.model.NodeSelectorTermBuilder 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 NodeSelectorTermBuilder extends NodeSelectorTermFluentImpl implements VisitableBuilder{
NodeSelectorTermFluent> fluent;
Boolean validationEnabled;
public NodeSelectorTermBuilder(){
this(true);
}
public NodeSelectorTermBuilder(Boolean validationEnabled){
this(new NodeSelectorTerm(), validationEnabled);
}
public NodeSelectorTermBuilder(NodeSelectorTermFluent> fluent){
this(fluent, true);
}
public NodeSelectorTermBuilder(NodeSelectorTermFluent> fluent,Boolean validationEnabled){
this(fluent, new NodeSelectorTerm(), validationEnabled);
}
public NodeSelectorTermBuilder(NodeSelectorTermFluent> fluent,NodeSelectorTerm instance){
this(fluent, instance, true);
}
public NodeSelectorTermBuilder(NodeSelectorTermFluent> fluent,NodeSelectorTerm instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withMatchExpressions(instance.getMatchExpressions());
this.validationEnabled = validationEnabled;
}
public NodeSelectorTermBuilder(NodeSelectorTerm instance){
this(instance,true);
}
public NodeSelectorTermBuilder(NodeSelectorTerm instance,Boolean validationEnabled){
this.fluent = this;
this.withMatchExpressions(instance.getMatchExpressions());
this.validationEnabled = validationEnabled;
}
public NodeSelectorTerm build(){
NodeSelectorTerm buildable = new NodeSelectorTerm(fluent.getMatchExpressions());
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;
NodeSelectorTermBuilder that = (NodeSelectorTermBuilder) 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;
}
}