All Downloads are FREE. Search and download functionalities are using the official Maven repository.

annotations.io.alauda.devops.api.model.BuildTriggerPolicyFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.devops.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import javax.validation.Valid;
import java.lang.Object;

public class BuildTriggerPolicyFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements BuildTriggerPolicyFluent{

    private WebHookTriggerBuilder bitbucket;
    private WebHookTriggerBuilder generic;
    private WebHookTriggerBuilder github;
    private WebHookTriggerBuilder gitlab;
    private ImageChangeTriggerBuilder imageChange;
    private String type;

    public BuildTriggerPolicyFluentImpl(){
    }
    public BuildTriggerPolicyFluentImpl(BuildTriggerPolicy instance){
            this.withBitbucket(instance.getBitbucket()); 
            this.withGeneric(instance.getGeneric()); 
            this.withGithub(instance.getGithub()); 
            this.withGitlab(instance.getGitlab()); 
            this.withImageChange(instance.getImageChange()); 
            this.withType(instance.getType()); 
    }

    
/**
 * This method has been deprecated, please use method buildBitbucket instead.
 */
@Deprecated public WebHookTrigger getBitbucket(){
            return this.bitbucket!=null?this.bitbucket.build():null;
    }

    public WebHookTrigger buildBitbucket(){
            return this.bitbucket!=null?this.bitbucket.build():null;
    }

    public A withBitbucket(WebHookTrigger bitbucket){
            _visitables.remove(this.bitbucket);
            if (bitbucket!=null){ this.bitbucket= new WebHookTriggerBuilder(bitbucket); _visitables.add(this.bitbucket);} return (A) this;
    }

    public Boolean hasBitbucket(){
            return this.bitbucket!=null;
    }

    public BuildTriggerPolicyFluent.BitbucketNested withNewBitbucket(){
            return new BitbucketNestedImpl();
    }

    public BuildTriggerPolicyFluent.BitbucketNested withNewBitbucketLike(WebHookTrigger item){
            return new BitbucketNestedImpl(item);
    }

    public BuildTriggerPolicyFluent.BitbucketNested editBitbucket(){
            return withNewBitbucketLike(getBitbucket());
    }

    public BuildTriggerPolicyFluent.BitbucketNested editOrNewBitbucket(){
            return withNewBitbucketLike(getBitbucket() != null ? getBitbucket(): new WebHookTriggerBuilder().build());
    }

    public BuildTriggerPolicyFluent.BitbucketNested editOrNewBitbucketLike(WebHookTrigger item){
            return withNewBitbucketLike(getBitbucket() != null ? getBitbucket(): item);
    }

    public A withNewBitbucket(Boolean allowEnv,String secret){
            return (A)withBitbucket(new WebHookTrigger(allowEnv, secret));
    }

    
/**
 * This method has been deprecated, please use method buildGeneric instead.
 */
@Deprecated public WebHookTrigger getGeneric(){
            return this.generic!=null?this.generic.build():null;
    }

    public WebHookTrigger buildGeneric(){
            return this.generic!=null?this.generic.build():null;
    }

    public A withGeneric(WebHookTrigger generic){
            _visitables.remove(this.generic);
            if (generic!=null){ this.generic= new WebHookTriggerBuilder(generic); _visitables.add(this.generic);} return (A) this;
    }

    public Boolean hasGeneric(){
            return this.generic!=null;
    }

    public BuildTriggerPolicyFluent.GenericNested withNewGeneric(){
            return new GenericNestedImpl();
    }

    public BuildTriggerPolicyFluent.GenericNested withNewGenericLike(WebHookTrigger item){
            return new GenericNestedImpl(item);
    }

    public BuildTriggerPolicyFluent.GenericNested editGeneric(){
            return withNewGenericLike(getGeneric());
    }

    public BuildTriggerPolicyFluent.GenericNested editOrNewGeneric(){
            return withNewGenericLike(getGeneric() != null ? getGeneric(): new WebHookTriggerBuilder().build());
    }

    public BuildTriggerPolicyFluent.GenericNested editOrNewGenericLike(WebHookTrigger item){
            return withNewGenericLike(getGeneric() != null ? getGeneric(): item);
    }

    public A withNewGeneric(Boolean allowEnv,String secret){
            return (A)withGeneric(new WebHookTrigger(allowEnv, secret));
    }

    
/**
 * This method has been deprecated, please use method buildGithub instead.
 */
@Deprecated public WebHookTrigger getGithub(){
            return this.github!=null?this.github.build():null;
    }

    public WebHookTrigger buildGithub(){
            return this.github!=null?this.github.build():null;
    }

    public A withGithub(WebHookTrigger github){
            _visitables.remove(this.github);
            if (github!=null){ this.github= new WebHookTriggerBuilder(github); _visitables.add(this.github);} return (A) this;
    }

    public Boolean hasGithub(){
            return this.github!=null;
    }

    public BuildTriggerPolicyFluent.GithubNested withNewGithub(){
            return new GithubNestedImpl();
    }

    public BuildTriggerPolicyFluent.GithubNested withNewGithubLike(WebHookTrigger item){
            return new GithubNestedImpl(item);
    }

    public BuildTriggerPolicyFluent.GithubNested editGithub(){
            return withNewGithubLike(getGithub());
    }

    public BuildTriggerPolicyFluent.GithubNested editOrNewGithub(){
            return withNewGithubLike(getGithub() != null ? getGithub(): new WebHookTriggerBuilder().build());
    }

    public BuildTriggerPolicyFluent.GithubNested editOrNewGithubLike(WebHookTrigger item){
            return withNewGithubLike(getGithub() != null ? getGithub(): item);
    }

    public A withNewGithub(Boolean allowEnv,String secret){
            return (A)withGithub(new WebHookTrigger(allowEnv, secret));
    }

    
/**
 * This method has been deprecated, please use method buildGitlab instead.
 */
@Deprecated public WebHookTrigger getGitlab(){
            return this.gitlab!=null?this.gitlab.build():null;
    }

    public WebHookTrigger buildGitlab(){
            return this.gitlab!=null?this.gitlab.build():null;
    }

    public A withGitlab(WebHookTrigger gitlab){
            _visitables.remove(this.gitlab);
            if (gitlab!=null){ this.gitlab= new WebHookTriggerBuilder(gitlab); _visitables.add(this.gitlab);} return (A) this;
    }

    public Boolean hasGitlab(){
            return this.gitlab!=null;
    }

    public BuildTriggerPolicyFluent.GitlabNested withNewGitlab(){
            return new GitlabNestedImpl();
    }

    public BuildTriggerPolicyFluent.GitlabNested withNewGitlabLike(WebHookTrigger item){
            return new GitlabNestedImpl(item);
    }

    public BuildTriggerPolicyFluent.GitlabNested editGitlab(){
            return withNewGitlabLike(getGitlab());
    }

    public BuildTriggerPolicyFluent.GitlabNested editOrNewGitlab(){
            return withNewGitlabLike(getGitlab() != null ? getGitlab(): new WebHookTriggerBuilder().build());
    }

    public BuildTriggerPolicyFluent.GitlabNested editOrNewGitlabLike(WebHookTrigger item){
            return withNewGitlabLike(getGitlab() != null ? getGitlab(): item);
    }

    public A withNewGitlab(Boolean allowEnv,String secret){
            return (A)withGitlab(new WebHookTrigger(allowEnv, secret));
    }

    
/**
 * This method has been deprecated, please use method buildImageChange instead.
 */
@Deprecated public ImageChangeTrigger getImageChange(){
            return this.imageChange!=null?this.imageChange.build():null;
    }

    public ImageChangeTrigger buildImageChange(){
            return this.imageChange!=null?this.imageChange.build():null;
    }

    public A withImageChange(ImageChangeTrigger imageChange){
            _visitables.remove(this.imageChange);
            if (imageChange!=null){ this.imageChange= new ImageChangeTriggerBuilder(imageChange); _visitables.add(this.imageChange);} return (A) this;
    }

    public Boolean hasImageChange(){
            return this.imageChange!=null;
    }

    public BuildTriggerPolicyFluent.ImageChangeNested withNewImageChange(){
            return new ImageChangeNestedImpl();
    }

    public BuildTriggerPolicyFluent.ImageChangeNested withNewImageChangeLike(ImageChangeTrigger item){
            return new ImageChangeNestedImpl(item);
    }

    public BuildTriggerPolicyFluent.ImageChangeNested editImageChange(){
            return withNewImageChangeLike(getImageChange());
    }

    public BuildTriggerPolicyFluent.ImageChangeNested editOrNewImageChange(){
            return withNewImageChangeLike(getImageChange() != null ? getImageChange(): new ImageChangeTriggerBuilder().build());
    }

    public BuildTriggerPolicyFluent.ImageChangeNested editOrNewImageChangeLike(ImageChangeTrigger item){
            return withNewImageChangeLike(getImageChange() != null ? getImageChange(): item);
    }

    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;
            BuildTriggerPolicyFluentImpl that = (BuildTriggerPolicyFluentImpl) o;
            if (bitbucket != null ? !bitbucket.equals(that.bitbucket) :that.bitbucket != null) return false;
            if (generic != null ? !generic.equals(that.generic) :that.generic != null) return false;
            if (github != null ? !github.equals(that.github) :that.github != null) return false;
            if (gitlab != null ? !gitlab.equals(that.gitlab) :that.gitlab != null) return false;
            if (imageChange != null ? !imageChange.equals(that.imageChange) :that.imageChange != null) return false;
            if (type != null ? !type.equals(that.type) :that.type != null) return false;
            return true;
    }


    public class BitbucketNestedImpl extends WebHookTriggerFluentImpl> implements BuildTriggerPolicyFluent.BitbucketNested,io.alauda.kubernetes.api.builder.Nested{

            private final WebHookTriggerBuilder builder;
    
            BitbucketNestedImpl(WebHookTrigger item){
                    this.builder = new WebHookTriggerBuilder(this, item);
            }
            BitbucketNestedImpl(){
                    this.builder = new WebHookTriggerBuilder(this);
            }
    
    public N and(){
            return (N) BuildTriggerPolicyFluentImpl.this.withBitbucket(builder.build());
    }
    public N endBitbucket(){
            return and();
    }

}
    public class GenericNestedImpl extends WebHookTriggerFluentImpl> implements BuildTriggerPolicyFluent.GenericNested,io.alauda.kubernetes.api.builder.Nested{

            private final WebHookTriggerBuilder builder;
    
            GenericNestedImpl(WebHookTrigger item){
                    this.builder = new WebHookTriggerBuilder(this, item);
            }
            GenericNestedImpl(){
                    this.builder = new WebHookTriggerBuilder(this);
            }
    
    public N and(){
            return (N) BuildTriggerPolicyFluentImpl.this.withGeneric(builder.build());
    }
    public N endGeneric(){
            return and();
    }

}
    public class GithubNestedImpl extends WebHookTriggerFluentImpl> implements BuildTriggerPolicyFluent.GithubNested,io.alauda.kubernetes.api.builder.Nested{

            private final WebHookTriggerBuilder builder;
    
            GithubNestedImpl(WebHookTrigger item){
                    this.builder = new WebHookTriggerBuilder(this, item);
            }
            GithubNestedImpl(){
                    this.builder = new WebHookTriggerBuilder(this);
            }
    
    public N and(){
            return (N) BuildTriggerPolicyFluentImpl.this.withGithub(builder.build());
    }
    public N endGithub(){
            return and();
    }

}
    public class GitlabNestedImpl extends WebHookTriggerFluentImpl> implements BuildTriggerPolicyFluent.GitlabNested,io.alauda.kubernetes.api.builder.Nested{

            private final WebHookTriggerBuilder builder;
    
            GitlabNestedImpl(WebHookTrigger item){
                    this.builder = new WebHookTriggerBuilder(this, item);
            }
            GitlabNestedImpl(){
                    this.builder = new WebHookTriggerBuilder(this);
            }
    
    public N and(){
            return (N) BuildTriggerPolicyFluentImpl.this.withGitlab(builder.build());
    }
    public N endGitlab(){
            return and();
    }

}
    public class ImageChangeNestedImpl extends ImageChangeTriggerFluentImpl> implements BuildTriggerPolicyFluent.ImageChangeNested,io.alauda.kubernetes.api.builder.Nested{

            private final ImageChangeTriggerBuilder builder;
    
            ImageChangeNestedImpl(ImageChangeTrigger item){
                    this.builder = new ImageChangeTriggerBuilder(this, item);
            }
            ImageChangeNestedImpl(){
                    this.builder = new ImageChangeTriggerBuilder(this);
            }
    
    public N and(){
            return (N) BuildTriggerPolicyFluentImpl.this.withImageChange(builder.build());
    }
    public N endImageChange(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy