io.alauda.kubernetes.api.model.PipelineSourceFluentImpl 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 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 LocalObjectReferenceBuilder secret;
public PipelineSourceFluentImpl(){
}
public PipelineSourceFluentImpl(PipelineSource instance){
this.withCodeRepository(instance.getCodeRepository());
this.withGit(instance.getGit());
this.withSecret(instance.getSecret());
}
/**
* 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);
}
/**
* 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 LocalObjectReference getSecret(){
return this.secret!=null?this.secret.build():null;
}
public LocalObjectReference buildSecret(){
return this.secret!=null?this.secret.build():null;
}
public A withSecret(LocalObjectReference secret){
_visitables.remove(this.secret);
if (secret!=null){ this.secret= new LocalObjectReferenceBuilder(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(LocalObjectReference item){
return new SecretNestedImpl(item);
}
public PipelineSourceFluent.SecretNested editSecret(){
return withNewSecretLike(getSecret());
}
public PipelineSourceFluent.SecretNested editOrNewSecret(){
return withNewSecretLike(getSecret() != null ? getSecret(): new LocalObjectReferenceBuilder().build());
}
public PipelineSourceFluent.SecretNested editOrNewSecretLike(LocalObjectReference item){
return withNewSecretLike(getSecret() != null ? getSecret(): item);
}
public A withNewSecret(String name){
return (A)withSecret(new LocalObjectReference(name));
}
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;
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 LocalObjectReferenceFluentImpl> implements PipelineSourceFluent.SecretNested,io.alauda.kubernetes.api.builder.Nested{
private final LocalObjectReferenceBuilder builder;
SecretNestedImpl(LocalObjectReference item){
this.builder = new LocalObjectReferenceBuilder(this, item);
}
SecretNestedImpl(){
this.builder = new LocalObjectReferenceBuilder(this);
}
public N and(){
return (N) PipelineSourceFluentImpl.this.withSecret(builder.build());
}
public N endSecret(){
return and();
}
}
}