annotations.io.alauda.devops.api.model.DeploymentStrategyFluentImpl Maven / Gradle / Ivy
package io.alauda.devops.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.model.ResourceRequirementsBuilder;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import io.alauda.kubernetes.api.model.ResourceRequirements;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import io.alauda.kubernetes.api.model.ResourceRequirementsFluentImpl;
import javax.validation.Valid;
import java.lang.Long;
import java.lang.Object;
import java.util.Map;
public class DeploymentStrategyFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements DeploymentStrategyFluent{
private Long activeDeadlineSeconds;
private Map annotations = new LinkedHashMap();
private CustomDeploymentStrategyParamsBuilder customParams;
private Map labels = new LinkedHashMap();
private RecreateDeploymentStrategyParamsBuilder recreateParams;
private ResourceRequirementsBuilder resources;
private RollingDeploymentStrategyParamsBuilder rollingParams;
private String type;
public DeploymentStrategyFluentImpl(){
}
public DeploymentStrategyFluentImpl(DeploymentStrategy instance){
this.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds());
this.withAnnotations(instance.getAnnotations());
this.withCustomParams(instance.getCustomParams());
this.withLabels(instance.getLabels());
this.withRecreateParams(instance.getRecreateParams());
this.withResources(instance.getResources());
this.withRollingParams(instance.getRollingParams());
this.withType(instance.getType());
}
public Long getActiveDeadlineSeconds(){
return this.activeDeadlineSeconds;
}
public A withActiveDeadlineSeconds(Long activeDeadlineSeconds){
this.activeDeadlineSeconds=activeDeadlineSeconds; return (A) this;
}
public Boolean hasActiveDeadlineSeconds(){
return this.activeDeadlineSeconds!=null;
}
public A addToAnnotations(String key,String value){
if(key != null && value != null) {this.annotations.put(key, value);} return (A)this;
}
public A addToAnnotations(Map map){
if(map != null) { this.annotations.putAll(map);} return (A)this;
}
public A removeFromAnnotations(String key){
if(key != null) {this.annotations.remove(key);} return (A)this;
}
public A removeFromAnnotations(Map map){
if(map != null) { for(Object key : map.keySet()) {this.annotations.remove(key);}} return (A)this;
}
public Map getAnnotations(){
return this.annotations;
}
public A withAnnotations(Map annotations){
this.annotations.clear();
if (annotations != null) {this.annotations.putAll(annotations);} return (A) this;
}
public Boolean hasAnnotations(){
return this.annotations!=null;
}
/**
* This method has been deprecated, please use method buildCustomParams instead.
*/
@Deprecated public CustomDeploymentStrategyParams getCustomParams(){
return this.customParams!=null?this.customParams.build():null;
}
public CustomDeploymentStrategyParams buildCustomParams(){
return this.customParams!=null?this.customParams.build():null;
}
public A withCustomParams(CustomDeploymentStrategyParams customParams){
_visitables.remove(this.customParams);
if (customParams!=null){ this.customParams= new CustomDeploymentStrategyParamsBuilder(customParams); _visitables.add(this.customParams);} return (A) this;
}
public Boolean hasCustomParams(){
return this.customParams!=null;
}
public DeploymentStrategyFluent.CustomParamsNested withNewCustomParams(){
return new CustomParamsNestedImpl();
}
public DeploymentStrategyFluent.CustomParamsNested withNewCustomParamsLike(CustomDeploymentStrategyParams item){
return new CustomParamsNestedImpl(item);
}
public DeploymentStrategyFluent.CustomParamsNested editCustomParams(){
return withNewCustomParamsLike(getCustomParams());
}
public DeploymentStrategyFluent.CustomParamsNested editOrNewCustomParams(){
return withNewCustomParamsLike(getCustomParams() != null ? getCustomParams(): new CustomDeploymentStrategyParamsBuilder().build());
}
public DeploymentStrategyFluent.CustomParamsNested editOrNewCustomParamsLike(CustomDeploymentStrategyParams item){
return withNewCustomParamsLike(getCustomParams() != null ? getCustomParams(): item);
}
public A addToLabels(String key,String value){
if(key != null && value != null) {this.labels.put(key, value);} return (A)this;
}
public A addToLabels(Map map){
if(map != null) { this.labels.putAll(map);} return (A)this;
}
public A removeFromLabels(String key){
if(key != null) {this.labels.remove(key);} return (A)this;
}
public A removeFromLabels(Map map){
if(map != null) { for(Object key : map.keySet()) {this.labels.remove(key);}} return (A)this;
}
public Map getLabels(){
return this.labels;
}
public A withLabels(Map labels){
this.labels.clear();
if (labels != null) {this.labels.putAll(labels);} return (A) this;
}
public Boolean hasLabels(){
return this.labels!=null;
}
/**
* This method has been deprecated, please use method buildRecreateParams instead.
*/
@Deprecated public RecreateDeploymentStrategyParams getRecreateParams(){
return this.recreateParams!=null?this.recreateParams.build():null;
}
public RecreateDeploymentStrategyParams buildRecreateParams(){
return this.recreateParams!=null?this.recreateParams.build():null;
}
public A withRecreateParams(RecreateDeploymentStrategyParams recreateParams){
_visitables.remove(this.recreateParams);
if (recreateParams!=null){ this.recreateParams= new RecreateDeploymentStrategyParamsBuilder(recreateParams); _visitables.add(this.recreateParams);} return (A) this;
}
public Boolean hasRecreateParams(){
return this.recreateParams!=null;
}
public DeploymentStrategyFluent.RecreateParamsNested withNewRecreateParams(){
return new RecreateParamsNestedImpl();
}
public DeploymentStrategyFluent.RecreateParamsNested withNewRecreateParamsLike(RecreateDeploymentStrategyParams item){
return new RecreateParamsNestedImpl(item);
}
public DeploymentStrategyFluent.RecreateParamsNested editRecreateParams(){
return withNewRecreateParamsLike(getRecreateParams());
}
public DeploymentStrategyFluent.RecreateParamsNested editOrNewRecreateParams(){
return withNewRecreateParamsLike(getRecreateParams() != null ? getRecreateParams(): new RecreateDeploymentStrategyParamsBuilder().build());
}
public DeploymentStrategyFluent.RecreateParamsNested editOrNewRecreateParamsLike(RecreateDeploymentStrategyParams item){
return withNewRecreateParamsLike(getRecreateParams() != null ? getRecreateParams(): item);
}
/**
* This method has been deprecated, please use method buildResources instead.
*/
@Deprecated public ResourceRequirements getResources(){
return this.resources!=null?this.resources.build():null;
}
public ResourceRequirements buildResources(){
return this.resources!=null?this.resources.build():null;
}
public A withResources(ResourceRequirements resources){
_visitables.remove(this.resources);
if (resources!=null){ this.resources= new ResourceRequirementsBuilder(resources); _visitables.add(this.resources);} return (A) this;
}
public Boolean hasResources(){
return this.resources!=null;
}
public DeploymentStrategyFluent.ResourcesNested withNewResources(){
return new ResourcesNestedImpl();
}
public DeploymentStrategyFluent.ResourcesNested withNewResourcesLike(ResourceRequirements item){
return new ResourcesNestedImpl(item);
}
public DeploymentStrategyFluent.ResourcesNested editResources(){
return withNewResourcesLike(getResources());
}
public DeploymentStrategyFluent.ResourcesNested editOrNewResources(){
return withNewResourcesLike(getResources() != null ? getResources(): new ResourceRequirementsBuilder().build());
}
public DeploymentStrategyFluent.ResourcesNested editOrNewResourcesLike(ResourceRequirements item){
return withNewResourcesLike(getResources() != null ? getResources(): item);
}
/**
* This method has been deprecated, please use method buildRollingParams instead.
*/
@Deprecated public RollingDeploymentStrategyParams getRollingParams(){
return this.rollingParams!=null?this.rollingParams.build():null;
}
public RollingDeploymentStrategyParams buildRollingParams(){
return this.rollingParams!=null?this.rollingParams.build():null;
}
public A withRollingParams(RollingDeploymentStrategyParams rollingParams){
_visitables.remove(this.rollingParams);
if (rollingParams!=null){ this.rollingParams= new RollingDeploymentStrategyParamsBuilder(rollingParams); _visitables.add(this.rollingParams);} return (A) this;
}
public Boolean hasRollingParams(){
return this.rollingParams!=null;
}
public DeploymentStrategyFluent.RollingParamsNested withNewRollingParams(){
return new RollingParamsNestedImpl();
}
public DeploymentStrategyFluent.RollingParamsNested withNewRollingParamsLike(RollingDeploymentStrategyParams item){
return new RollingParamsNestedImpl(item);
}
public DeploymentStrategyFluent.RollingParamsNested editRollingParams(){
return withNewRollingParamsLike(getRollingParams());
}
public DeploymentStrategyFluent.RollingParamsNested editOrNewRollingParams(){
return withNewRollingParamsLike(getRollingParams() != null ? getRollingParams(): new RollingDeploymentStrategyParamsBuilder().build());
}
public DeploymentStrategyFluent.RollingParamsNested editOrNewRollingParamsLike(RollingDeploymentStrategyParams item){
return withNewRollingParamsLike(getRollingParams() != null ? getRollingParams(): item);
}
public String getType(){
return this.type;
}
public A withType(String type){
this.type=type; return (A) this;
}
public Boolean hasType(){
return this.type!=null;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeploymentStrategyFluentImpl that = (DeploymentStrategyFluentImpl) o;
if (activeDeadlineSeconds != null ? !activeDeadlineSeconds.equals(that.activeDeadlineSeconds) :that.activeDeadlineSeconds != null) return false;
if (annotations != null ? !annotations.equals(that.annotations) :that.annotations != null) return false;
if (customParams != null ? !customParams.equals(that.customParams) :that.customParams != null) return false;
if (labels != null ? !labels.equals(that.labels) :that.labels != null) return false;
if (recreateParams != null ? !recreateParams.equals(that.recreateParams) :that.recreateParams != null) return false;
if (resources != null ? !resources.equals(that.resources) :that.resources != null) return false;
if (rollingParams != null ? !rollingParams.equals(that.rollingParams) :that.rollingParams != null) return false;
if (type != null ? !type.equals(that.type) :that.type != null) return false;
return true;
}
public class CustomParamsNestedImpl extends CustomDeploymentStrategyParamsFluentImpl> implements DeploymentStrategyFluent.CustomParamsNested,io.alauda.kubernetes.api.builder.Nested{
private final CustomDeploymentStrategyParamsBuilder builder;
CustomParamsNestedImpl(CustomDeploymentStrategyParams item){
this.builder = new CustomDeploymentStrategyParamsBuilder(this, item);
}
CustomParamsNestedImpl(){
this.builder = new CustomDeploymentStrategyParamsBuilder(this);
}
public N and(){
return (N) DeploymentStrategyFluentImpl.this.withCustomParams(builder.build());
}
public N endCustomParams(){
return and();
}
}
public class RecreateParamsNestedImpl extends RecreateDeploymentStrategyParamsFluentImpl> implements DeploymentStrategyFluent.RecreateParamsNested,io.alauda.kubernetes.api.builder.Nested{
private final RecreateDeploymentStrategyParamsBuilder builder;
RecreateParamsNestedImpl(RecreateDeploymentStrategyParams item){
this.builder = new RecreateDeploymentStrategyParamsBuilder(this, item);
}
RecreateParamsNestedImpl(){
this.builder = new RecreateDeploymentStrategyParamsBuilder(this);
}
public N and(){
return (N) DeploymentStrategyFluentImpl.this.withRecreateParams(builder.build());
}
public N endRecreateParams(){
return and();
}
}
public class ResourcesNestedImpl extends ResourceRequirementsFluentImpl> implements DeploymentStrategyFluent.ResourcesNested,io.alauda.kubernetes.api.builder.Nested{
private final ResourceRequirementsBuilder builder;
ResourcesNestedImpl(ResourceRequirements item){
this.builder = new ResourceRequirementsBuilder(this, item);
}
ResourcesNestedImpl(){
this.builder = new ResourceRequirementsBuilder(this);
}
public N and(){
return (N) DeploymentStrategyFluentImpl.this.withResources(builder.build());
}
public N endResources(){
return and();
}
}
public class RollingParamsNestedImpl extends RollingDeploymentStrategyParamsFluentImpl> implements DeploymentStrategyFluent.RollingParamsNested,io.alauda.kubernetes.api.builder.Nested{
private final RollingDeploymentStrategyParamsBuilder builder;
RollingParamsNestedImpl(RollingDeploymentStrategyParams item){
this.builder = new RollingDeploymentStrategyParamsBuilder(this, item);
}
RollingParamsNestedImpl(){
this.builder = new RollingDeploymentStrategyParamsBuilder(this);
}
public N and(){
return (N) DeploymentStrategyFluentImpl.this.withRollingParams(builder.build());
}
public N endRollingParams(){
return and();
}
}
}