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

annotations.io.alauda.kubernetes.api.model.extensions.DeploymentSpecFluentImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.model.PodTemplateSpecFluentImpl;
import io.alauda.kubernetes.api.model.LabelSelectorFluentImpl;
import io.alauda.kubernetes.api.builder.Nested;
import io.alauda.kubernetes.api.model.PodTemplateSpec;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import io.alauda.kubernetes.api.model.LabelSelectorBuilder;
import io.alauda.kubernetes.api.model.LabelSelector;
import java.lang.Integer;
import javax.validation.Valid;
import io.alauda.kubernetes.api.model.PodTemplateSpecBuilder;
import java.lang.Long;
import java.lang.Object;

public class DeploymentSpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements DeploymentSpecFluent{

    private Integer minReadySeconds;
    private Boolean paused;
    private Integer progressDeadlineSeconds;
    private Integer replicas;
    private Integer revisionHistoryLimit;
    private RollbackConfigBuilder rollbackTo;
    private LabelSelectorBuilder selector;
    private DeploymentStrategyBuilder strategy;
    private PodTemplateSpecBuilder template;

    public DeploymentSpecFluentImpl(){
    }
    public DeploymentSpecFluentImpl(DeploymentSpec instance){
            this.withMinReadySeconds(instance.getMinReadySeconds()); 
            this.withPaused(instance.getPaused()); 
            this.withProgressDeadlineSeconds(instance.getProgressDeadlineSeconds()); 
            this.withReplicas(instance.getReplicas()); 
            this.withRevisionHistoryLimit(instance.getRevisionHistoryLimit()); 
            this.withRollbackTo(instance.getRollbackTo()); 
            this.withSelector(instance.getSelector()); 
            this.withStrategy(instance.getStrategy()); 
            this.withTemplate(instance.getTemplate()); 
    }

    public Integer getMinReadySeconds(){
            return this.minReadySeconds;
    }

    public A withMinReadySeconds(Integer minReadySeconds){
            this.minReadySeconds=minReadySeconds; return (A) this;
    }

    public Boolean hasMinReadySeconds(){
            return this.minReadySeconds!=null;
    }

    public Boolean isPaused(){
            return this.paused;
    }

    public A withPaused(Boolean paused){
            this.paused=paused; return (A) this;
    }

    public Boolean hasPaused(){
            return this.paused!=null;
    }

    public Integer getProgressDeadlineSeconds(){
            return this.progressDeadlineSeconds;
    }

    public A withProgressDeadlineSeconds(Integer progressDeadlineSeconds){
            this.progressDeadlineSeconds=progressDeadlineSeconds; return (A) this;
    }

    public Boolean hasProgressDeadlineSeconds(){
            return this.progressDeadlineSeconds!=null;
    }

    public Integer getReplicas(){
            return this.replicas;
    }

    public A withReplicas(Integer replicas){
            this.replicas=replicas; return (A) this;
    }

    public Boolean hasReplicas(){
            return this.replicas!=null;
    }

    public Integer getRevisionHistoryLimit(){
            return this.revisionHistoryLimit;
    }

    public A withRevisionHistoryLimit(Integer revisionHistoryLimit){
            this.revisionHistoryLimit=revisionHistoryLimit; return (A) this;
    }

    public Boolean hasRevisionHistoryLimit(){
            return this.revisionHistoryLimit!=null;
    }

    
/**
 * This method has been deprecated, please use method buildRollbackTo instead.
 */
@Deprecated public RollbackConfig getRollbackTo(){
            return this.rollbackTo!=null?this.rollbackTo.build():null;
    }

    public RollbackConfig buildRollbackTo(){
            return this.rollbackTo!=null?this.rollbackTo.build():null;
    }

    public A withRollbackTo(RollbackConfig rollbackTo){
            _visitables.remove(this.rollbackTo);
            if (rollbackTo!=null){ this.rollbackTo= new RollbackConfigBuilder(rollbackTo); _visitables.add(this.rollbackTo);} return (A) this;
    }

    public Boolean hasRollbackTo(){
            return this.rollbackTo!=null;
    }

    public DeploymentSpecFluent.RollbackToNested withNewRollbackTo(){
            return new RollbackToNestedImpl();
    }

    public DeploymentSpecFluent.RollbackToNested withNewRollbackToLike(RollbackConfig item){
            return new RollbackToNestedImpl(item);
    }

    public DeploymentSpecFluent.RollbackToNested editRollbackTo(){
            return withNewRollbackToLike(getRollbackTo());
    }

    public DeploymentSpecFluent.RollbackToNested editOrNewRollbackTo(){
            return withNewRollbackToLike(getRollbackTo() != null ? getRollbackTo(): new RollbackConfigBuilder().build());
    }

    public DeploymentSpecFluent.RollbackToNested editOrNewRollbackToLike(RollbackConfig item){
            return withNewRollbackToLike(getRollbackTo() != null ? getRollbackTo(): item);
    }

    public A withNewRollbackTo(Long revision){
            return (A)withRollbackTo(new RollbackConfig(revision));
    }

    
/**
 * This method has been deprecated, please use method buildSelector instead.
 */
@Deprecated public LabelSelector getSelector(){
            return this.selector!=null?this.selector.build():null;
    }

    public LabelSelector buildSelector(){
            return this.selector!=null?this.selector.build():null;
    }

    public A withSelector(LabelSelector selector){
            _visitables.remove(this.selector);
            if (selector!=null){ this.selector= new LabelSelectorBuilder(selector); _visitables.add(this.selector);} return (A) this;
    }

    public Boolean hasSelector(){
            return this.selector!=null;
    }

    public DeploymentSpecFluent.SelectorNested withNewSelector(){
            return new SelectorNestedImpl();
    }

    public DeploymentSpecFluent.SelectorNested withNewSelectorLike(LabelSelector item){
            return new SelectorNestedImpl(item);
    }

    public DeploymentSpecFluent.SelectorNested editSelector(){
            return withNewSelectorLike(getSelector());
    }

    public DeploymentSpecFluent.SelectorNested editOrNewSelector(){
            return withNewSelectorLike(getSelector() != null ? getSelector(): new LabelSelectorBuilder().build());
    }

    public DeploymentSpecFluent.SelectorNested editOrNewSelectorLike(LabelSelector item){
            return withNewSelectorLike(getSelector() != null ? getSelector(): item);
    }

    
/**
 * This method has been deprecated, please use method buildStrategy instead.
 */
@Deprecated public DeploymentStrategy getStrategy(){
            return this.strategy!=null?this.strategy.build():null;
    }

    public DeploymentStrategy buildStrategy(){
            return this.strategy!=null?this.strategy.build():null;
    }

    public A withStrategy(DeploymentStrategy strategy){
            _visitables.remove(this.strategy);
            if (strategy!=null){ this.strategy= new DeploymentStrategyBuilder(strategy); _visitables.add(this.strategy);} return (A) this;
    }

    public Boolean hasStrategy(){
            return this.strategy!=null;
    }

    public DeploymentSpecFluent.StrategyNested withNewStrategy(){
            return new StrategyNestedImpl();
    }

    public DeploymentSpecFluent.StrategyNested withNewStrategyLike(DeploymentStrategy item){
            return new StrategyNestedImpl(item);
    }

    public DeploymentSpecFluent.StrategyNested editStrategy(){
            return withNewStrategyLike(getStrategy());
    }

    public DeploymentSpecFluent.StrategyNested editOrNewStrategy(){
            return withNewStrategyLike(getStrategy() != null ? getStrategy(): new DeploymentStrategyBuilder().build());
    }

    public DeploymentSpecFluent.StrategyNested editOrNewStrategyLike(DeploymentStrategy item){
            return withNewStrategyLike(getStrategy() != null ? getStrategy(): item);
    }

    
/**
 * This method has been deprecated, please use method buildTemplate instead.
 */
@Deprecated public PodTemplateSpec getTemplate(){
            return this.template!=null?this.template.build():null;
    }

    public PodTemplateSpec buildTemplate(){
            return this.template!=null?this.template.build():null;
    }

    public A withTemplate(PodTemplateSpec template){
            _visitables.remove(this.template);
            if (template!=null){ this.template= new PodTemplateSpecBuilder(template); _visitables.add(this.template);} return (A) this;
    }

    public Boolean hasTemplate(){
            return this.template!=null;
    }

    public DeploymentSpecFluent.TemplateNested withNewTemplate(){
            return new TemplateNestedImpl();
    }

    public DeploymentSpecFluent.TemplateNested withNewTemplateLike(PodTemplateSpec item){
            return new TemplateNestedImpl(item);
    }

    public DeploymentSpecFluent.TemplateNested editTemplate(){
            return withNewTemplateLike(getTemplate());
    }

    public DeploymentSpecFluent.TemplateNested editOrNewTemplate(){
            return withNewTemplateLike(getTemplate() != null ? getTemplate(): new PodTemplateSpecBuilder().build());
    }

    public DeploymentSpecFluent.TemplateNested editOrNewTemplateLike(PodTemplateSpec item){
            return withNewTemplateLike(getTemplate() != null ? getTemplate(): 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;
            DeploymentSpecFluentImpl that = (DeploymentSpecFluentImpl) o;
            if (minReadySeconds != null ? !minReadySeconds.equals(that.minReadySeconds) :that.minReadySeconds != null) return false;
            if (paused != null ? !paused.equals(that.paused) :that.paused != null) return false;
            if (progressDeadlineSeconds != null ? !progressDeadlineSeconds.equals(that.progressDeadlineSeconds) :that.progressDeadlineSeconds != null) return false;
            if (replicas != null ? !replicas.equals(that.replicas) :that.replicas != null) return false;
            if (revisionHistoryLimit != null ? !revisionHistoryLimit.equals(that.revisionHistoryLimit) :that.revisionHistoryLimit != null) return false;
            if (rollbackTo != null ? !rollbackTo.equals(that.rollbackTo) :that.rollbackTo != null) return false;
            if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
            if (strategy != null ? !strategy.equals(that.strategy) :that.strategy != null) return false;
            if (template != null ? !template.equals(that.template) :that.template != null) return false;
            return true;
    }


    public class RollbackToNestedImpl extends RollbackConfigFluentImpl> implements DeploymentSpecFluent.RollbackToNested,io.alauda.kubernetes.api.builder.Nested{

            private final RollbackConfigBuilder builder;
    
            RollbackToNestedImpl(RollbackConfig item){
                    this.builder = new RollbackConfigBuilder(this, item);
            }
            RollbackToNestedImpl(){
                    this.builder = new RollbackConfigBuilder(this);
            }
    
    public N and(){
            return (N) DeploymentSpecFluentImpl.this.withRollbackTo(builder.build());
    }
    public N endRollbackTo(){
            return and();
    }

}
    public class SelectorNestedImpl extends LabelSelectorFluentImpl> implements DeploymentSpecFluent.SelectorNested,io.alauda.kubernetes.api.builder.Nested{

            private final LabelSelectorBuilder builder;
    
            SelectorNestedImpl(LabelSelector item){
                    this.builder = new LabelSelectorBuilder(this, item);
            }
            SelectorNestedImpl(){
                    this.builder = new LabelSelectorBuilder(this);
            }
    
    public N and(){
            return (N) DeploymentSpecFluentImpl.this.withSelector(builder.build());
    }
    public N endSelector(){
            return and();
    }

}
    public class StrategyNestedImpl extends DeploymentStrategyFluentImpl> implements DeploymentSpecFluent.StrategyNested,io.alauda.kubernetes.api.builder.Nested{

            private final DeploymentStrategyBuilder builder;
    
            StrategyNestedImpl(DeploymentStrategy item){
                    this.builder = new DeploymentStrategyBuilder(this, item);
            }
            StrategyNestedImpl(){
                    this.builder = new DeploymentStrategyBuilder(this);
            }
    
    public N and(){
            return (N) DeploymentSpecFluentImpl.this.withStrategy(builder.build());
    }
    public N endStrategy(){
            return and();
    }

}
    public class TemplateNestedImpl extends PodTemplateSpecFluentImpl> implements DeploymentSpecFluent.TemplateNested,io.alauda.kubernetes.api.builder.Nested{

            private final PodTemplateSpecBuilder builder;
    
            TemplateNestedImpl(PodTemplateSpec item){
                    this.builder = new PodTemplateSpecBuilder(this, item);
            }
            TemplateNestedImpl(){
                    this.builder = new PodTemplateSpecBuilder(this);
            }
    
    public N and(){
            return (N) DeploymentSpecFluentImpl.this.withTemplate(builder.build());
    }
    public N endTemplate(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy