io.alauda.kubernetes.api.model.JenkinsPluginBuilder 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 JenkinsPluginBuilder extends JenkinsPluginFluentImpl implements VisitableBuilder{
JenkinsPluginFluent> fluent;
Boolean validationEnabled;
public JenkinsPluginBuilder(){
this(true);
}
public JenkinsPluginBuilder(Boolean validationEnabled){
this(new JenkinsPlugin(), validationEnabled);
}
public JenkinsPluginBuilder(JenkinsPluginFluent> fluent){
this(fluent, true);
}
public JenkinsPluginBuilder(JenkinsPluginFluent> fluent,Boolean validationEnabled){
this(fluent, new JenkinsPlugin(), validationEnabled);
}
public JenkinsPluginBuilder(JenkinsPluginFluent> fluent,JenkinsPlugin instance){
this(fluent, instance, true);
}
public JenkinsPluginBuilder(JenkinsPluginFluent> fluent,JenkinsPlugin instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withName(instance.getName());
fluent.withVersion(instance.getVersion());
this.validationEnabled = validationEnabled;
}
public JenkinsPluginBuilder(JenkinsPlugin instance){
this(instance,true);
}
public JenkinsPluginBuilder(JenkinsPlugin instance,Boolean validationEnabled){
this.fluent = this;
this.withName(instance.getName());
this.withVersion(instance.getVersion());
this.validationEnabled = validationEnabled;
}
public JenkinsPlugin build(){
JenkinsPlugin buildable = new JenkinsPlugin(fluent.getName(),fluent.getVersion());
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;
JenkinsPluginBuilder that = (JenkinsPluginBuilder) 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;
}
}