annotations.io.alauda.kubernetes.api.model.CodeRepositorySpecFluentImpl 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 CodeRepositorySpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements CodeRepositorySpecFluent{
private LocalObjectReferenceBuilder codeRepoBinding;
private OriginCodeRepositoryBuilder repository;
public CodeRepositorySpecFluentImpl(){
}
public CodeRepositorySpecFluentImpl(CodeRepositorySpec instance){
this.withCodeRepoBinding(instance.getCodeRepoBinding());
this.withRepository(instance.getRepository());
}
/**
* This method has been deprecated, please use method buildCodeRepoBinding instead.
*/
@Deprecated public LocalObjectReference getCodeRepoBinding(){
return this.codeRepoBinding!=null?this.codeRepoBinding.build():null;
}
public LocalObjectReference buildCodeRepoBinding(){
return this.codeRepoBinding!=null?this.codeRepoBinding.build():null;
}
public A withCodeRepoBinding(LocalObjectReference codeRepoBinding){
_visitables.remove(this.codeRepoBinding);
if (codeRepoBinding!=null){ this.codeRepoBinding= new LocalObjectReferenceBuilder(codeRepoBinding); _visitables.add(this.codeRepoBinding);} return (A) this;
}
public Boolean hasCodeRepoBinding(){
return this.codeRepoBinding!=null;
}
public CodeRepositorySpecFluent.CodeRepoBindingNested withNewCodeRepoBinding(){
return new CodeRepoBindingNestedImpl();
}
public CodeRepositorySpecFluent.CodeRepoBindingNested withNewCodeRepoBindingLike(LocalObjectReference item){
return new CodeRepoBindingNestedImpl(item);
}
public CodeRepositorySpecFluent.CodeRepoBindingNested editCodeRepoBinding(){
return withNewCodeRepoBindingLike(getCodeRepoBinding());
}
public CodeRepositorySpecFluent.CodeRepoBindingNested editOrNewCodeRepoBinding(){
return withNewCodeRepoBindingLike(getCodeRepoBinding() != null ? getCodeRepoBinding(): new LocalObjectReferenceBuilder().build());
}
public CodeRepositorySpecFluent.CodeRepoBindingNested editOrNewCodeRepoBindingLike(LocalObjectReference item){
return withNewCodeRepoBindingLike(getCodeRepoBinding() != null ? getCodeRepoBinding(): item);
}
public A withNewCodeRepoBinding(String name){
return (A)withCodeRepoBinding(new LocalObjectReference(name));
}
/**
* This method has been deprecated, please use method buildRepository instead.
*/
@Deprecated public OriginCodeRepository getRepository(){
return this.repository!=null?this.repository.build():null;
}
public OriginCodeRepository buildRepository(){
return this.repository!=null?this.repository.build():null;
}
public A withRepository(OriginCodeRepository repository){
_visitables.remove(this.repository);
if (repository!=null){ this.repository= new OriginCodeRepositoryBuilder(repository); _visitables.add(this.repository);} return (A) this;
}
public Boolean hasRepository(){
return this.repository!=null;
}
public CodeRepositorySpecFluent.RepositoryNested withNewRepository(){
return new RepositoryNestedImpl();
}
public CodeRepositorySpecFluent.RepositoryNested withNewRepositoryLike(OriginCodeRepository item){
return new RepositoryNestedImpl(item);
}
public CodeRepositorySpecFluent.RepositoryNested editRepository(){
return withNewRepositoryLike(getRepository());
}
public CodeRepositorySpecFluent.RepositoryNested editOrNewRepository(){
return withNewRepositoryLike(getRepository() != null ? getRepository(): new OriginCodeRepositoryBuilder().build());
}
public CodeRepositorySpecFluent.RepositoryNested editOrNewRepositoryLike(OriginCodeRepository item){
return withNewRepositoryLike(getRepository() != null ? getRepository(): 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;
CodeRepositorySpecFluentImpl that = (CodeRepositorySpecFluentImpl) o;
if (codeRepoBinding != null ? !codeRepoBinding.equals(that.codeRepoBinding) :that.codeRepoBinding != null) return false;
if (repository != null ? !repository.equals(that.repository) :that.repository != null) return false;
return true;
}
public class CodeRepoBindingNestedImpl extends LocalObjectReferenceFluentImpl> implements CodeRepositorySpecFluent.CodeRepoBindingNested,io.alauda.kubernetes.api.builder.Nested{
private final LocalObjectReferenceBuilder builder;
CodeRepoBindingNestedImpl(LocalObjectReference item){
this.builder = new LocalObjectReferenceBuilder(this, item);
}
CodeRepoBindingNestedImpl(){
this.builder = new LocalObjectReferenceBuilder(this);
}
public N and(){
return (N) CodeRepositorySpecFluentImpl.this.withCodeRepoBinding(builder.build());
}
public N endCodeRepoBinding(){
return and();
}
}
public class RepositoryNestedImpl extends OriginCodeRepositoryFluentImpl> implements CodeRepositorySpecFluent.RepositoryNested,io.alauda.kubernetes.api.builder.Nested{
private final OriginCodeRepositoryBuilder builder;
RepositoryNestedImpl(OriginCodeRepository item){
this.builder = new OriginCodeRepositoryBuilder(this, item);
}
RepositoryNestedImpl(){
this.builder = new OriginCodeRepositoryBuilder(this);
}
public N and(){
return (N) CodeRepositorySpecFluentImpl.this.withRepository(builder.build());
}
public N endRepository(){
return and();
}
}
}