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

annotations.io.fabric8.openshift.api.model.DeploymentStrategyFluentImpl Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package io.fabric8.openshift.api.model;

import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.String;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.model.ResourceRequirements;
import java.lang.Object;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.ResourceRequirementsFluentImpl;
import io.fabric8.kubernetes.api.model.ResourceRequirementsBuilder;

public class DeploymentStrategyFluentImpl> extends BaseFluent implements DeploymentStrategyFluent{

    private Map annotations = new LinkedHashMap();
    private VisitableBuilder customParams;
    private Map labels = new LinkedHashMap();
    private VisitableBuilder recreateParams;
    private VisitableBuilder resources;
    private VisitableBuilder rollingParams;
    private String type;

    public DeploymentStrategyFluentImpl(){
    }
    public DeploymentStrategyFluentImpl(DeploymentStrategy instance){
            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 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 CustomDeploymentStrategyParams getCustomParams(){
            return this.customParams!=null?this.customParams.build():null;
    }

    public A withCustomParams(CustomDeploymentStrategyParams customParams){
            if (customParams!=null){ this.customParams= new CustomDeploymentStrategyParamsBuilder(customParams); _visitables.add(this.customParams);} return (A) this;
    }

    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 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 RecreateDeploymentStrategyParams getRecreateParams(){
            return this.recreateParams!=null?this.recreateParams.build():null;
    }

    public A withRecreateParams(RecreateDeploymentStrategyParams recreateParams){
            if (recreateParams!=null){ this.recreateParams= new RecreateDeploymentStrategyParamsBuilder(recreateParams); _visitables.add(this.recreateParams);} return (A) this;
    }

    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 ResourceRequirements getResources(){
            return this.resources!=null?this.resources.build():null;
    }

    public A withResources(ResourceRequirements resources){
            if (resources!=null){ this.resources= new ResourceRequirementsBuilder(resources); _visitables.add(this.resources);} return (A) this;
    }

    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 RollingDeploymentStrategyParams getRollingParams(){
            return this.rollingParams!=null?this.rollingParams.build():null;
    }

    public A withRollingParams(RollingDeploymentStrategyParams rollingParams){
            if (rollingParams!=null){ this.rollingParams= new RollingDeploymentStrategyParamsBuilder(rollingParams); _visitables.add(this.rollingParams);} return (A) this;
    }

    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 String getType(){
            return this.type;
    }

    public A withType(String type){
            this.type=type; return (A) this;
    }

    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 (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,Nested{

            private final CustomDeploymentStrategyParamsBuilder builder;
    
            CustomParamsNestedImpl(CustomDeploymentStrategyParams item){
                    this.builder = new CustomDeploymentStrategyParamsBuilder(this, item);
            }
            CustomParamsNestedImpl(){
                    this.builder = new CustomDeploymentStrategyParamsBuilder(this);
            }
    
    public N endCustomParams(){
            return and();
    }
    public N and(){
            return (N) DeploymentStrategyFluentImpl.this.withCustomParams(builder.build());
    }

}
    public class RecreateParamsNestedImpl extends RecreateDeploymentStrategyParamsFluentImpl> implements DeploymentStrategyFluent.RecreateParamsNested,Nested{

            private final RecreateDeploymentStrategyParamsBuilder builder;
    
            RecreateParamsNestedImpl(){
                    this.builder = new RecreateDeploymentStrategyParamsBuilder(this);
            }
            RecreateParamsNestedImpl(RecreateDeploymentStrategyParams item){
                    this.builder = new RecreateDeploymentStrategyParamsBuilder(this, item);
            }
    
    public N endRecreateParams(){
            return and();
    }
    public N and(){
            return (N) DeploymentStrategyFluentImpl.this.withRecreateParams(builder.build());
    }

}
    public class ResourcesNestedImpl extends ResourceRequirementsFluentImpl> implements DeploymentStrategyFluent.ResourcesNested,Nested{

            private final ResourceRequirementsBuilder builder;
    
            ResourcesNestedImpl(){
                    this.builder = new ResourceRequirementsBuilder(this);
            }
            ResourcesNestedImpl(ResourceRequirements item){
                    this.builder = new ResourceRequirementsBuilder(this, item);
            }
    
    public N endResources(){
            return and();
    }
    public N and(){
            return (N) DeploymentStrategyFluentImpl.this.withResources(builder.build());
    }

}
    public class RollingParamsNestedImpl extends RollingDeploymentStrategyParamsFluentImpl> implements DeploymentStrategyFluent.RollingParamsNested,Nested{

            private final RollingDeploymentStrategyParamsBuilder builder;
    
            RollingParamsNestedImpl(){
                    this.builder = new RollingDeploymentStrategyParamsBuilder(this);
            }
            RollingParamsNestedImpl(RollingDeploymentStrategyParams item){
                    this.builder = new RollingDeploymentStrategyParamsBuilder(this, item);
            }
    
    public N endRollingParams(){
            return and();
    }
    public N and(){
            return (N) DeploymentStrategyFluentImpl.this.withRollingParams(builder.build());
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy