
annotations.io.fabric8.openshift.api.model.DeploymentConfigSpecFluentImpl Maven / Gradle / Ivy
package io.fabric8.openshift.api.model;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Integer;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.Boolean;
import java.lang.String;
import java.util.Map;
import javax.validation.Valid;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.util.List;
import java.util.ArrayList;
import io.fabric8.kubernetes.api.model.PodTemplateSpec;
import java.lang.Object;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.PodTemplateSpecFluentImpl;
import io.fabric8.kubernetes.api.model.PodTemplateSpecBuilder;
public class DeploymentConfigSpecFluentImpl> extends BaseFluent implements DeploymentConfigSpecFluent{
private Integer minReadySeconds;
private Boolean paused;
private Integer replicas;
private Integer revisionHistoryLimit;
private Map selector = new LinkedHashMap();
private VisitableBuilder extends DeploymentStrategy,?> strategy;
private VisitableBuilder extends PodTemplateSpec,?> template;
private Boolean test;
private List> triggers = new ArrayList>();
public DeploymentConfigSpecFluentImpl(){
}
public DeploymentConfigSpecFluentImpl(DeploymentConfigSpec instance){
this.withMinReadySeconds(instance.getMinReadySeconds());
this.withPaused(instance.getPaused());
this.withReplicas(instance.getReplicas());
this.withRevisionHistoryLimit(instance.getRevisionHistoryLimit());
this.withSelector(instance.getSelector());
this.withStrategy(instance.getStrategy());
this.withTemplate(instance.getTemplate());
this.withTest(instance.getTest());
this.withTriggers(instance.getTriggers());
}
public Integer getMinReadySeconds(){
return this.minReadySeconds;
}
public A withMinReadySeconds(Integer minReadySeconds){
this.minReadySeconds=minReadySeconds; return (A) this;
}
public Boolean isPaused(){
return this.paused;
}
public A withPaused(Boolean paused){
this.paused=paused; return (A) this;
}
public Integer getReplicas(){
return this.replicas;
}
public A withReplicas(Integer replicas){
this.replicas=replicas; return (A) this;
}
public Integer getRevisionHistoryLimit(){
return this.revisionHistoryLimit;
}
public A withRevisionHistoryLimit(Integer revisionHistoryLimit){
this.revisionHistoryLimit=revisionHistoryLimit; return (A) this;
}
public A addToSelector(String key,String value){
if(key != null && value != null) {this.selector.put(key, value);} return (A)this;
}
public A addToSelector(Map map){
if(map != null) { this.selector.putAll(map);} return (A)this;
}
public A removeFromSelector(String key){
if(key != null) {this.selector.remove(key);} return (A)this;
}
public A removeFromSelector(Map map){
if(map != null) { for(Object key : map.keySet()) {this.selector.remove(key);}} return (A)this;
}
public Map getSelector(){
return this.selector;
}
public A withSelector(Map selector){
this.selector.clear();
if (selector != null) {this.selector.putAll(selector);} return (A) this;
}
public DeploymentStrategy getStrategy(){
return this.strategy!=null?this.strategy.build():null;
}
public A withStrategy(DeploymentStrategy strategy){
if (strategy!=null){ this.strategy= new DeploymentStrategyBuilder(strategy); _visitables.add(this.strategy);} return (A) this;
}
public DeploymentConfigSpecFluent.StrategyNested withNewStrategy(){
return new StrategyNestedImpl();
}
public DeploymentConfigSpecFluent.StrategyNested withNewStrategyLike(DeploymentStrategy item){
return new StrategyNestedImpl(item);
}
public DeploymentConfigSpecFluent.StrategyNested editStrategy(){
return withNewStrategyLike(getStrategy());
}
public PodTemplateSpec getTemplate(){
return this.template!=null?this.template.build():null;
}
public A withTemplate(PodTemplateSpec template){
if (template!=null){ this.template= new PodTemplateSpecBuilder(template); _visitables.add(this.template);} return (A) this;
}
public DeploymentConfigSpecFluent.TemplateNested withNewTemplate(){
return new TemplateNestedImpl();
}
public DeploymentConfigSpecFluent.TemplateNested withNewTemplateLike(PodTemplateSpec item){
return new TemplateNestedImpl(item);
}
public DeploymentConfigSpecFluent.TemplateNested editTemplate(){
return withNewTemplateLike(getTemplate());
}
public Boolean isTest(){
return this.test;
}
public A withTest(Boolean test){
this.test=test; return (A) this;
}
public A addToTriggers(DeploymentTriggerPolicy... items){
for (DeploymentTriggerPolicy item : items) {DeploymentTriggerPolicyBuilder builder = new DeploymentTriggerPolicyBuilder(item);_visitables.add(builder);this.triggers.add(builder);} return (A)this;
}
public A removeFromTriggers(DeploymentTriggerPolicy... items){
for (DeploymentTriggerPolicy item : items) {DeploymentTriggerPolicyBuilder builder = new DeploymentTriggerPolicyBuilder(item);_visitables.remove(builder);this.triggers.remove(builder);} return (A)this;
}
public List getTriggers(){
return build(triggers);
}
public A withTriggers(List triggers){
this.triggers.clear();
if (triggers != null) {for (DeploymentTriggerPolicy item : triggers){this.addToTriggers(item);}} return (A) this;
}
public A withTriggers(DeploymentTriggerPolicy... triggers){
this.triggers.clear(); if (triggers != null) {for (DeploymentTriggerPolicy item :triggers){ this.addToTriggers(item);}} return (A) this;
}
public DeploymentConfigSpecFluent.TriggersNested addNewTrigger(){
return new TriggersNestedImpl();
}
public DeploymentConfigSpecFluent.TriggersNested addNewTriggerLike(DeploymentTriggerPolicy item){
return new TriggersNestedImpl(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;
DeploymentConfigSpecFluentImpl that = (DeploymentConfigSpecFluentImpl) 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 (replicas != null ? !replicas.equals(that.replicas) :that.replicas != null) return false;
if (revisionHistoryLimit != null ? !revisionHistoryLimit.equals(that.revisionHistoryLimit) :that.revisionHistoryLimit != 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;
if (test != null ? !test.equals(that.test) :that.test != null) return false;
if (triggers != null ? !triggers.equals(that.triggers) :that.triggers != null) return false;
return true;
}
public class StrategyNestedImpl extends DeploymentStrategyFluentImpl> implements DeploymentConfigSpecFluent.StrategyNested,Nested{
private final DeploymentStrategyBuilder builder;
StrategyNestedImpl(DeploymentStrategy item){
this.builder = new DeploymentStrategyBuilder(this, item);
}
StrategyNestedImpl(){
this.builder = new DeploymentStrategyBuilder(this);
}
public N endStrategy(){
return and();
}
public N and(){
return (N) DeploymentConfigSpecFluentImpl.this.withStrategy(builder.build());
}
}
public class TemplateNestedImpl extends PodTemplateSpecFluentImpl> implements DeploymentConfigSpecFluent.TemplateNested,Nested{
private final PodTemplateSpecBuilder builder;
TemplateNestedImpl(){
this.builder = new PodTemplateSpecBuilder(this);
}
TemplateNestedImpl(PodTemplateSpec item){
this.builder = new PodTemplateSpecBuilder(this, item);
}
public N endTemplate(){
return and();
}
public N and(){
return (N) DeploymentConfigSpecFluentImpl.this.withTemplate(builder.build());
}
}
public class TriggersNestedImpl extends DeploymentTriggerPolicyFluentImpl> implements DeploymentConfigSpecFluent.TriggersNested,Nested{
private final DeploymentTriggerPolicyBuilder builder;
TriggersNestedImpl(){
this.builder = new DeploymentTriggerPolicyBuilder(this);
}
TriggersNestedImpl(DeploymentTriggerPolicy item){
this.builder = new DeploymentTriggerPolicyBuilder(this, item);
}
public N endTrigger(){
return and();
}
public N and(){
return (N) DeploymentConfigSpecFluentImpl.this.addToTriggers(builder.build());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy