io.alauda.kubernetes.api.model.PipelineTriggerFluentImpl 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.String;
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 PipelineTriggerFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PipelineTriggerFluent{
private PipelineTriggerCodeChangeBuilder codeChange;
private PipelineTriggerCronBuilder cron;
private String type;
public PipelineTriggerFluentImpl(){
}
public PipelineTriggerFluentImpl(PipelineTrigger instance){
this.withCodeChange(instance.getCodeChange());
this.withCron(instance.getCron());
this.withType(instance.getType());
}
/**
* This method has been deprecated, please use method buildCodeChange instead.
*/
@Deprecated public PipelineTriggerCodeChange getCodeChange(){
return this.codeChange!=null?this.codeChange.build():null;
}
public PipelineTriggerCodeChange buildCodeChange(){
return this.codeChange!=null?this.codeChange.build():null;
}
public A withCodeChange(PipelineTriggerCodeChange codeChange){
_visitables.remove(this.codeChange);
if (codeChange!=null){ this.codeChange= new PipelineTriggerCodeChangeBuilder(codeChange); _visitables.add(this.codeChange);} return (A) this;
}
public Boolean hasCodeChange(){
return this.codeChange!=null;
}
public PipelineTriggerFluent.CodeChangeNested withNewCodeChange(){
return new CodeChangeNestedImpl();
}
public PipelineTriggerFluent.CodeChangeNested withNewCodeChangeLike(PipelineTriggerCodeChange item){
return new CodeChangeNestedImpl(item);
}
public PipelineTriggerFluent.CodeChangeNested editCodeChange(){
return withNewCodeChangeLike(getCodeChange());
}
public PipelineTriggerFluent.CodeChangeNested editOrNewCodeChange(){
return withNewCodeChangeLike(getCodeChange() != null ? getCodeChange(): new PipelineTriggerCodeChangeBuilder().build());
}
public PipelineTriggerFluent.CodeChangeNested editOrNewCodeChangeLike(PipelineTriggerCodeChange item){
return withNewCodeChangeLike(getCodeChange() != null ? getCodeChange(): item);
}
public A withNewCodeChange(Boolean enabled,String periodicCheck){
return (A)withCodeChange(new PipelineTriggerCodeChange(enabled, periodicCheck));
}
/**
* This method has been deprecated, please use method buildCron instead.
*/
@Deprecated public PipelineTriggerCron getCron(){
return this.cron!=null?this.cron.build():null;
}
public PipelineTriggerCron buildCron(){
return this.cron!=null?this.cron.build():null;
}
public A withCron(PipelineTriggerCron cron){
_visitables.remove(this.cron);
if (cron!=null){ this.cron= new PipelineTriggerCronBuilder(cron); _visitables.add(this.cron);} return (A) this;
}
public Boolean hasCron(){
return this.cron!=null;
}
public PipelineTriggerFluent.CronNested withNewCron(){
return new CronNestedImpl();
}
public PipelineTriggerFluent.CronNested withNewCronLike(PipelineTriggerCron item){
return new CronNestedImpl(item);
}
public PipelineTriggerFluent.CronNested editCron(){
return withNewCronLike(getCron());
}
public PipelineTriggerFluent.CronNested editOrNewCron(){
return withNewCronLike(getCron() != null ? getCron(): new PipelineTriggerCronBuilder().build());
}
public PipelineTriggerFluent.CronNested editOrNewCronLike(PipelineTriggerCron item){
return withNewCronLike(getCron() != null ? getCron(): item);
}
public A withNewCron(Boolean enabled,String rule){
return (A)withCron(new PipelineTriggerCron(enabled, rule));
}
public String getType(){
return this.type;
}
public A withType(String type){
this.type=type; return (A) this;
}
public Boolean hasType(){
return this.type!=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;
PipelineTriggerFluentImpl that = (PipelineTriggerFluentImpl) o;
if (codeChange != null ? !codeChange.equals(that.codeChange) :that.codeChange != null) return false;
if (cron != null ? !cron.equals(that.cron) :that.cron != null) return false;
if (type != null ? !type.equals(that.type) :that.type != null) return false;
return true;
}
public class CodeChangeNestedImpl extends PipelineTriggerCodeChangeFluentImpl> implements PipelineTriggerFluent.CodeChangeNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineTriggerCodeChangeBuilder builder;
CodeChangeNestedImpl(PipelineTriggerCodeChange item){
this.builder = new PipelineTriggerCodeChangeBuilder(this, item);
}
CodeChangeNestedImpl(){
this.builder = new PipelineTriggerCodeChangeBuilder(this);
}
public N and(){
return (N) PipelineTriggerFluentImpl.this.withCodeChange(builder.build());
}
public N endCodeChange(){
return and();
}
}
public class CronNestedImpl extends PipelineTriggerCronFluentImpl> implements PipelineTriggerFluent.CronNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineTriggerCronBuilder builder;
CronNestedImpl(PipelineTriggerCron item){
this.builder = new PipelineTriggerCronBuilder(this, item);
}
CronNestedImpl(){
this.builder = new PipelineTriggerCronBuilder(this);
}
public N and(){
return (N) PipelineTriggerFluentImpl.this.withCron(builder.build());
}
public N endCron(){
return and();
}
}
}