annotations.io.alauda.kubernetes.api.model.PipelineStrategyFluentImpl 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 PipelineStrategyFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PipelineStrategyFluent{
private PipelineStrategyJenkinsBuilder jenkins;
private PipelineConfigTemplateBuilder template;
public PipelineStrategyFluentImpl(){
}
public PipelineStrategyFluentImpl(PipelineStrategy instance){
this.withJenkins(instance.getJenkins());
this.withTemplate(instance.getTemplate());
}
/**
* This method has been deprecated, please use method buildJenkins instead.
*/
@Deprecated public PipelineStrategyJenkins getJenkins(){
return this.jenkins!=null?this.jenkins.build():null;
}
public PipelineStrategyJenkins buildJenkins(){
return this.jenkins!=null?this.jenkins.build():null;
}
public A withJenkins(PipelineStrategyJenkins jenkins){
_visitables.remove(this.jenkins);
if (jenkins!=null){ this.jenkins= new PipelineStrategyJenkinsBuilder(jenkins); _visitables.add(this.jenkins);} return (A) this;
}
public Boolean hasJenkins(){
return this.jenkins!=null;
}
public PipelineStrategyFluent.JenkinsNested withNewJenkins(){
return new JenkinsNestedImpl();
}
public PipelineStrategyFluent.JenkinsNested withNewJenkinsLike(PipelineStrategyJenkins item){
return new JenkinsNestedImpl(item);
}
public PipelineStrategyFluent.JenkinsNested editJenkins(){
return withNewJenkinsLike(getJenkins());
}
public PipelineStrategyFluent.JenkinsNested editOrNewJenkins(){
return withNewJenkinsLike(getJenkins() != null ? getJenkins(): new PipelineStrategyJenkinsBuilder().build());
}
public PipelineStrategyFluent.JenkinsNested editOrNewJenkinsLike(PipelineStrategyJenkins item){
return withNewJenkinsLike(getJenkins() != null ? getJenkins(): item);
}
public A withNewJenkins(String jenkinsfile,String jenkinsfilePath){
return (A)withJenkins(new PipelineStrategyJenkins(jenkinsfile, jenkinsfilePath));
}
/**
* This method has been deprecated, please use method buildTemplate instead.
*/
@Deprecated public PipelineConfigTemplate getTemplate(){
return this.template!=null?this.template.build():null;
}
public PipelineConfigTemplate buildTemplate(){
return this.template!=null?this.template.build():null;
}
public A withTemplate(PipelineConfigTemplate template){
_visitables.remove(this.template);
if (template!=null){ this.template= new PipelineConfigTemplateBuilder(template); _visitables.add(this.template);} return (A) this;
}
public Boolean hasTemplate(){
return this.template!=null;
}
public PipelineStrategyFluent.TemplateNested withNewTemplate(){
return new TemplateNestedImpl();
}
public PipelineStrategyFluent.TemplateNested withNewTemplateLike(PipelineConfigTemplate item){
return new TemplateNestedImpl(item);
}
public PipelineStrategyFluent.TemplateNested editTemplate(){
return withNewTemplateLike(getTemplate());
}
public PipelineStrategyFluent.TemplateNested editOrNewTemplate(){
return withNewTemplateLike(getTemplate() != null ? getTemplate(): new PipelineConfigTemplateBuilder().build());
}
public PipelineStrategyFluent.TemplateNested editOrNewTemplateLike(PipelineConfigTemplate item){
return withNewTemplateLike(getTemplate() != null ? getTemplate(): 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;
PipelineStrategyFluentImpl that = (PipelineStrategyFluentImpl) o;
if (jenkins != null ? !jenkins.equals(that.jenkins) :that.jenkins != null) return false;
if (template != null ? !template.equals(that.template) :that.template != null) return false;
return true;
}
public class JenkinsNestedImpl extends PipelineStrategyJenkinsFluentImpl> implements PipelineStrategyFluent.JenkinsNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineStrategyJenkinsBuilder builder;
JenkinsNestedImpl(PipelineStrategyJenkins item){
this.builder = new PipelineStrategyJenkinsBuilder(this, item);
}
JenkinsNestedImpl(){
this.builder = new PipelineStrategyJenkinsBuilder(this);
}
public N and(){
return (N) PipelineStrategyFluentImpl.this.withJenkins(builder.build());
}
public N endJenkins(){
return and();
}
}
public class TemplateNestedImpl extends PipelineConfigTemplateFluentImpl> implements PipelineStrategyFluent.TemplateNested,io.alauda.kubernetes.api.builder.Nested{
private final PipelineConfigTemplateBuilder builder;
TemplateNestedImpl(PipelineConfigTemplate item){
this.builder = new PipelineConfigTemplateBuilder(this, item);
}
TemplateNestedImpl(){
this.builder = new PipelineConfigTemplateBuilder(this);
}
public N and(){
return (N) PipelineStrategyFluentImpl.this.withTemplate(builder.build());
}
public N endTemplate(){
return and();
}
}
}