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

io.alauda.kubernetes.api.model.PipelineSourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
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 io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import javax.validation.Valid;
import java.lang.Object;

public class PipelineSourceFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PipelineSourceFluent{

    private CodeRepositoryRefBuilder codeRepository;
    private PipelineSourceGitBuilder git;
    private SecretKeySetRefBuilder secret;
    private String sourceType;
    private PipelineSourceSvnBuilder svn;

    public PipelineSourceFluentImpl(){
    }
    public PipelineSourceFluentImpl(PipelineSource instance){
            this.withCodeRepository(instance.getCodeRepository()); 
            this.withGit(instance.getGit()); 
            this.withSecret(instance.getSecret()); 
            this.withSourceType(instance.getSourceType()); 
            this.withSvn(instance.getSvn()); 
    }

    
/**
 * This method has been deprecated, please use method buildCodeRepository instead.
 */
@Deprecated public CodeRepositoryRef getCodeRepository(){
            return this.codeRepository!=null?this.codeRepository.build():null;
    }

    public CodeRepositoryRef buildCodeRepository(){
            return this.codeRepository!=null?this.codeRepository.build():null;
    }

    public A withCodeRepository(CodeRepositoryRef codeRepository){
            _visitables.remove(this.codeRepository);
            if (codeRepository!=null){ this.codeRepository= new CodeRepositoryRefBuilder(codeRepository); _visitables.add(this.codeRepository);} return (A) this;
    }

    public Boolean hasCodeRepository(){
            return this.codeRepository!=null;
    }

    public PipelineSourceFluent.CodeRepositoryNested withNewCodeRepository(){
            return new CodeRepositoryNestedImpl();
    }

    public PipelineSourceFluent.CodeRepositoryNested withNewCodeRepositoryLike(CodeRepositoryRef item){
            return new CodeRepositoryNestedImpl(item);
    }

    public PipelineSourceFluent.CodeRepositoryNested editCodeRepository(){
            return withNewCodeRepositoryLike(getCodeRepository());
    }

    public PipelineSourceFluent.CodeRepositoryNested editOrNewCodeRepository(){
            return withNewCodeRepositoryLike(getCodeRepository() != null ? getCodeRepository(): new CodeRepositoryRefBuilder().build());
    }

    public PipelineSourceFluent.CodeRepositoryNested editOrNewCodeRepositoryLike(CodeRepositoryRef item){
            return withNewCodeRepositoryLike(getCodeRepository() != null ? getCodeRepository(): item);
    }

    public A withNewCodeRepository(String name,String ref){
            return (A)withCodeRepository(new CodeRepositoryRef(name, ref));
    }

    
/**
 * This method has been deprecated, please use method buildGit instead.
 */
@Deprecated public PipelineSourceGit getGit(){
            return this.git!=null?this.git.build():null;
    }

    public PipelineSourceGit buildGit(){
            return this.git!=null?this.git.build():null;
    }

    public A withGit(PipelineSourceGit git){
            _visitables.remove(this.git);
            if (git!=null){ this.git= new PipelineSourceGitBuilder(git); _visitables.add(this.git);} return (A) this;
    }

    public Boolean hasGit(){
            return this.git!=null;
    }

    public PipelineSourceFluent.GitNested withNewGit(){
            return new GitNestedImpl();
    }

    public PipelineSourceFluent.GitNested withNewGitLike(PipelineSourceGit item){
            return new GitNestedImpl(item);
    }

    public PipelineSourceFluent.GitNested editGit(){
            return withNewGitLike(getGit());
    }

    public PipelineSourceFluent.GitNested editOrNewGit(){
            return withNewGitLike(getGit() != null ? getGit(): new PipelineSourceGitBuilder().build());
    }

    public PipelineSourceFluent.GitNested editOrNewGitLike(PipelineSourceGit item){
            return withNewGitLike(getGit() != null ? getGit(): item);
    }

    public A withNewGit(String ref,String uri){
            return (A)withGit(new PipelineSourceGit(ref, uri));
    }

    
/**
 * This method has been deprecated, please use method buildSecret instead.
 */
@Deprecated public SecretKeySetRef getSecret(){
            return this.secret!=null?this.secret.build():null;
    }

    public SecretKeySetRef buildSecret(){
            return this.secret!=null?this.secret.build():null;
    }

    public A withSecret(SecretKeySetRef secret){
            _visitables.remove(this.secret);
            if (secret!=null){ this.secret= new SecretKeySetRefBuilder(secret); _visitables.add(this.secret);} return (A) this;
    }

    public Boolean hasSecret(){
            return this.secret!=null;
    }

    public PipelineSourceFluent.SecretNested withNewSecret(){
            return new SecretNestedImpl();
    }

    public PipelineSourceFluent.SecretNested withNewSecretLike(SecretKeySetRef item){
            return new SecretNestedImpl(item);
    }

    public PipelineSourceFluent.SecretNested editSecret(){
            return withNewSecretLike(getSecret());
    }

    public PipelineSourceFluent.SecretNested editOrNewSecret(){
            return withNewSecretLike(getSecret() != null ? getSecret(): new SecretKeySetRefBuilder().build());
    }

    public PipelineSourceFluent.SecretNested editOrNewSecretLike(SecretKeySetRef item){
            return withNewSecretLike(getSecret() != null ? getSecret(): item);
    }

    public A withNewSecret(String apiTokenKey,String name,String namespace,String usernameKey){
            return (A)withSecret(new SecretKeySetRef(apiTokenKey, name, namespace, usernameKey));
    }

    public String getSourceType(){
            return this.sourceType;
    }

    public A withSourceType(String sourceType){
            this.sourceType=sourceType; return (A) this;
    }

    public Boolean hasSourceType(){
            return this.sourceType!=null;
    }

    
/**
 * This method has been deprecated, please use method buildSvn instead.
 */
@Deprecated public PipelineSourceSvn getSvn(){
            return this.svn!=null?this.svn.build():null;
    }

    public PipelineSourceSvn buildSvn(){
            return this.svn!=null?this.svn.build():null;
    }

    public A withSvn(PipelineSourceSvn svn){
            _visitables.remove(this.svn);
            if (svn!=null){ this.svn= new PipelineSourceSvnBuilder(svn); _visitables.add(this.svn);} return (A) this;
    }

    public Boolean hasSvn(){
            return this.svn!=null;
    }

    public PipelineSourceFluent.SvnNested withNewSvn(){
            return new SvnNestedImpl();
    }

    public PipelineSourceFluent.SvnNested withNewSvnLike(PipelineSourceSvn item){
            return new SvnNestedImpl(item);
    }

    public PipelineSourceFluent.SvnNested editSvn(){
            return withNewSvnLike(getSvn());
    }

    public PipelineSourceFluent.SvnNested editOrNewSvn(){
            return withNewSvnLike(getSvn() != null ? getSvn(): new PipelineSourceSvnBuilder().build());
    }

    public PipelineSourceFluent.SvnNested editOrNewSvnLike(PipelineSourceSvn item){
            return withNewSvnLike(getSvn() != null ? getSvn(): item);
    }

    public A withNewSvn(String uri){
            return (A)withSvn(new PipelineSourceSvn(uri));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            PipelineSourceFluentImpl that = (PipelineSourceFluentImpl) o;
            if (codeRepository != null ? !codeRepository.equals(that.codeRepository) :that.codeRepository != null) return false;
            if (git != null ? !git.equals(that.git) :that.git != null) return false;
            if (secret != null ? !secret.equals(that.secret) :that.secret != null) return false;
            if (sourceType != null ? !sourceType.equals(that.sourceType) :that.sourceType != null) return false;
            if (svn != null ? !svn.equals(that.svn) :that.svn != null) return false;
            return true;
    }


    public class CodeRepositoryNestedImpl extends CodeRepositoryRefFluentImpl> implements PipelineSourceFluent.CodeRepositoryNested,io.alauda.kubernetes.api.builder.Nested{

            private final CodeRepositoryRefBuilder builder;
    
            CodeRepositoryNestedImpl(CodeRepositoryRef item){
                    this.builder = new CodeRepositoryRefBuilder(this, item);
            }
            CodeRepositoryNestedImpl(){
                    this.builder = new CodeRepositoryRefBuilder(this);
            }
    
    public N and(){
            return (N) PipelineSourceFluentImpl.this.withCodeRepository(builder.build());
    }
    public N endCodeRepository(){
            return and();
    }

}
    public class GitNestedImpl extends PipelineSourceGitFluentImpl> implements PipelineSourceFluent.GitNested,io.alauda.kubernetes.api.builder.Nested{

            private final PipelineSourceGitBuilder builder;
    
            GitNestedImpl(PipelineSourceGit item){
                    this.builder = new PipelineSourceGitBuilder(this, item);
            }
            GitNestedImpl(){
                    this.builder = new PipelineSourceGitBuilder(this);
            }
    
    public N and(){
            return (N) PipelineSourceFluentImpl.this.withGit(builder.build());
    }
    public N endGit(){
            return and();
    }

}
    public class SecretNestedImpl extends SecretKeySetRefFluentImpl> implements PipelineSourceFluent.SecretNested,io.alauda.kubernetes.api.builder.Nested{

            private final SecretKeySetRefBuilder builder;
    
            SecretNestedImpl(SecretKeySetRef item){
                    this.builder = new SecretKeySetRefBuilder(this, item);
            }
            SecretNestedImpl(){
                    this.builder = new SecretKeySetRefBuilder(this);
            }
    
    public N and(){
            return (N) PipelineSourceFluentImpl.this.withSecret(builder.build());
    }
    public N endSecret(){
            return and();
    }

}
    public class SvnNestedImpl extends PipelineSourceSvnFluentImpl> implements PipelineSourceFluent.SvnNested,io.alauda.kubernetes.api.builder.Nested{

            private final PipelineSourceSvnBuilder builder;
    
            SvnNestedImpl(PipelineSourceSvn item){
                    this.builder = new PipelineSourceSvnBuilder(this, item);
            }
            SvnNestedImpl(){
                    this.builder = new PipelineSourceSvnBuilder(this);
            }
    
    public N and(){
            return (N) PipelineSourceFluentImpl.this.withSvn(builder.build());
    }
    public N endSvn(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy