annotations.io.alauda.kubernetes.api.model.PipelineStrategyJenkinsFluentImpl 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 PipelineStrategyJenkinsFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PipelineStrategyJenkinsFluent{
private String jenkinsfile;
private String jenkinsfilePath;
private MultiBranchPipelineBuilder multiBranch;
public PipelineStrategyJenkinsFluentImpl(){
}
public PipelineStrategyJenkinsFluentImpl(PipelineStrategyJenkins instance){
this.withJenkinsfile(instance.getJenkinsfile());
this.withJenkinsfilePath(instance.getJenkinsfilePath());
this.withMultiBranch(instance.getMultiBranch());
}
public String getJenkinsfile(){
return this.jenkinsfile;
}
public A withJenkinsfile(String jenkinsfile){
this.jenkinsfile=jenkinsfile; return (A) this;
}
public Boolean hasJenkinsfile(){
return this.jenkinsfile!=null;
}
public String getJenkinsfilePath(){
return this.jenkinsfilePath;
}
public A withJenkinsfilePath(String jenkinsfilePath){
this.jenkinsfilePath=jenkinsfilePath; return (A) this;
}
public Boolean hasJenkinsfilePath(){
return this.jenkinsfilePath!=null;
}
/**
* This method has been deprecated, please use method buildMultiBranch instead.
*/
@Deprecated public MultiBranchPipeline getMultiBranch(){
return this.multiBranch!=null?this.multiBranch.build():null;
}
public MultiBranchPipeline buildMultiBranch(){
return this.multiBranch!=null?this.multiBranch.build():null;
}
public A withMultiBranch(MultiBranchPipeline multiBranch){
_visitables.remove(this.multiBranch);
if (multiBranch!=null){ this.multiBranch= new MultiBranchPipelineBuilder(multiBranch); _visitables.add(this.multiBranch);} return (A) this;
}
public Boolean hasMultiBranch(){
return this.multiBranch!=null;
}
public PipelineStrategyJenkinsFluent.MultiBranchNested withNewMultiBranch(){
return new MultiBranchNestedImpl();
}
public PipelineStrategyJenkinsFluent.MultiBranchNested withNewMultiBranchLike(MultiBranchPipeline item){
return new MultiBranchNestedImpl(item);
}
public PipelineStrategyJenkinsFluent.MultiBranchNested editMultiBranch(){
return withNewMultiBranchLike(getMultiBranch());
}
public PipelineStrategyJenkinsFluent.MultiBranchNested editOrNewMultiBranch(){
return withNewMultiBranchLike(getMultiBranch() != null ? getMultiBranch(): new MultiBranchPipelineBuilder().build());
}
public PipelineStrategyJenkinsFluent.MultiBranchNested editOrNewMultiBranchLike(MultiBranchPipeline item){
return withNewMultiBranchLike(getMultiBranch() != null ? getMultiBranch(): item);
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
PipelineStrategyJenkinsFluentImpl that = (PipelineStrategyJenkinsFluentImpl) o;
if (jenkinsfile != null ? !jenkinsfile.equals(that.jenkinsfile) :that.jenkinsfile != null) return false;
if (jenkinsfilePath != null ? !jenkinsfilePath.equals(that.jenkinsfilePath) :that.jenkinsfilePath != null) return false;
if (multiBranch != null ? !multiBranch.equals(that.multiBranch) :that.multiBranch != null) return false;
return true;
}
public class MultiBranchNestedImpl extends MultiBranchPipelineFluentImpl> implements PipelineStrategyJenkinsFluent.MultiBranchNested,io.alauda.kubernetes.api.builder.Nested{
private final MultiBranchPipelineBuilder builder;
MultiBranchNestedImpl(MultiBranchPipeline item){
this.builder = new MultiBranchPipelineBuilder(this, item);
}
MultiBranchNestedImpl(){
this.builder = new MultiBranchPipelineBuilder(this);
}
public N and(){
return (N) PipelineStrategyJenkinsFluentImpl.this.withMultiBranch(builder.build());
}
public N endMultiBranch(){
return and();
}
}
}