annotations.io.alauda.kubernetes.api.model.PipelineTriggerBuilder 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 PipelineTriggerBuilder extends PipelineTriggerFluentImpl implements VisitableBuilder{
PipelineTriggerFluent> fluent;
Boolean validationEnabled;
public PipelineTriggerBuilder(){
this(true);
}
public PipelineTriggerBuilder(Boolean validationEnabled){
this(new PipelineTrigger(), validationEnabled);
}
public PipelineTriggerBuilder(PipelineTriggerFluent> fluent){
this(fluent, true);
}
public PipelineTriggerBuilder(PipelineTriggerFluent> fluent,Boolean validationEnabled){
this(fluent, new PipelineTrigger(), validationEnabled);
}
public PipelineTriggerBuilder(PipelineTriggerFluent> fluent,PipelineTrigger instance){
this(fluent, instance, true);
}
public PipelineTriggerBuilder(PipelineTriggerFluent> fluent,PipelineTrigger instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withCodeChange(instance.getCodeChange());
fluent.withCron(instance.getCron());
fluent.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public PipelineTriggerBuilder(PipelineTrigger instance){
this(instance,true);
}
public PipelineTriggerBuilder(PipelineTrigger instance,Boolean validationEnabled){
this.fluent = this;
this.withCodeChange(instance.getCodeChange());
this.withCron(instance.getCron());
this.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public PipelineTrigger build(){
PipelineTrigger buildable = new PipelineTrigger(fluent.getCodeChange(),fluent.getCron(),fluent.getType());
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;
PipelineTriggerBuilder that = (PipelineTriggerBuilder) 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;
}
}