io.alauda.kubernetes.api.model.JenkinsBindingSpecFluentImpl 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 JenkinsBindingSpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements JenkinsBindingSpecFluent{
private UserAccountBuilder account;
private JenkinsInstanceBuilder jenkins;
public JenkinsBindingSpecFluentImpl(){
}
public JenkinsBindingSpecFluentImpl(JenkinsBindingSpec instance){
this.withAccount(instance.getAccount());
this.withJenkins(instance.getJenkins());
}
/**
* This method has been deprecated, please use method buildAccount instead.
*/
@Deprecated public UserAccount getAccount(){
return this.account!=null?this.account.build():null;
}
public UserAccount buildAccount(){
return this.account!=null?this.account.build():null;
}
public A withAccount(UserAccount account){
_visitables.remove(this.account);
if (account!=null){ this.account= new UserAccountBuilder(account); _visitables.add(this.account);} return (A) this;
}
public Boolean hasAccount(){
return this.account!=null;
}
public JenkinsBindingSpecFluent.AccountNested withNewAccount(){
return new AccountNestedImpl();
}
public JenkinsBindingSpecFluent.AccountNested withNewAccountLike(UserAccount item){
return new AccountNestedImpl(item);
}
public JenkinsBindingSpecFluent.AccountNested editAccount(){
return withNewAccountLike(getAccount());
}
public JenkinsBindingSpecFluent.AccountNested editOrNewAccount(){
return withNewAccountLike(getAccount() != null ? getAccount(): new UserAccountBuilder().build());
}
public JenkinsBindingSpecFluent.AccountNested editOrNewAccountLike(UserAccount item){
return withNewAccountLike(getAccount() != null ? getAccount(): item);
}
/**
* This method has been deprecated, please use method buildJenkins instead.
*/
@Deprecated public JenkinsInstance getJenkins(){
return this.jenkins!=null?this.jenkins.build():null;
}
public JenkinsInstance buildJenkins(){
return this.jenkins!=null?this.jenkins.build():null;
}
public A withJenkins(JenkinsInstance jenkins){
_visitables.remove(this.jenkins);
if (jenkins!=null){ this.jenkins= new JenkinsInstanceBuilder(jenkins); _visitables.add(this.jenkins);} return (A) this;
}
public Boolean hasJenkins(){
return this.jenkins!=null;
}
public JenkinsBindingSpecFluent.JenkinsNested withNewJenkins(){
return new JenkinsNestedImpl();
}
public JenkinsBindingSpecFluent.JenkinsNested withNewJenkinsLike(JenkinsInstance item){
return new JenkinsNestedImpl(item);
}
public JenkinsBindingSpecFluent.JenkinsNested editJenkins(){
return withNewJenkinsLike(getJenkins());
}
public JenkinsBindingSpecFluent.JenkinsNested editOrNewJenkins(){
return withNewJenkinsLike(getJenkins() != null ? getJenkins(): new JenkinsInstanceBuilder().build());
}
public JenkinsBindingSpecFluent.JenkinsNested editOrNewJenkinsLike(JenkinsInstance item){
return withNewJenkinsLike(getJenkins() != null ? getJenkins(): item);
}
public A withNewJenkins(String name){
return (A)withJenkins(new JenkinsInstance(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;
JenkinsBindingSpecFluentImpl that = (JenkinsBindingSpecFluentImpl) o;
if (account != null ? !account.equals(that.account) :that.account != null) return false;
if (jenkins != null ? !jenkins.equals(that.jenkins) :that.jenkins != null) return false;
return true;
}
public class AccountNestedImpl extends UserAccountFluentImpl> implements JenkinsBindingSpecFluent.AccountNested,io.alauda.kubernetes.api.builder.Nested{
private final UserAccountBuilder builder;
AccountNestedImpl(UserAccount item){
this.builder = new UserAccountBuilder(this, item);
}
AccountNestedImpl(){
this.builder = new UserAccountBuilder(this);
}
public N and(){
return (N) JenkinsBindingSpecFluentImpl.this.withAccount(builder.build());
}
public N endAccount(){
return and();
}
}
public class JenkinsNestedImpl extends JenkinsInstanceFluentImpl> implements JenkinsBindingSpecFluent.JenkinsNested,io.alauda.kubernetes.api.builder.Nested{
private final JenkinsInstanceBuilder builder;
JenkinsNestedImpl(JenkinsInstance item){
this.builder = new JenkinsInstanceBuilder(this, item);
}
JenkinsNestedImpl(){
this.builder = new JenkinsInstanceBuilder(this);
}
public N and(){
return (N) JenkinsBindingSpecFluentImpl.this.withJenkins(builder.build());
}
public N endJenkins(){
return and();
}
}
}