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

io.kubernetes.client.models.ExtensionsV1beta1DeploymentRollbackFluentImpl Maven / Gradle / Ivy

package io.kubernetes.client.models;

import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

public class ExtensionsV1beta1DeploymentRollbackFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements ExtensionsV1beta1DeploymentRollbackFluent{

    private String apiVersion;
    private String kind;
    private String name;
    private ExtensionsV1beta1RollbackConfigBuilder rollbackTo;
    private Map updatedAnnotations;

    public ExtensionsV1beta1DeploymentRollbackFluentImpl(){
    }
    public ExtensionsV1beta1DeploymentRollbackFluentImpl(ExtensionsV1beta1DeploymentRollback instance){
            this.withApiVersion(instance.getApiVersion());

            this.withKind(instance.getKind());

            this.withName(instance.getName());

            this.withRollbackTo(instance.getRollbackTo());

            this.withUpdatedAnnotations(instance.getUpdatedAnnotations());

    }

    public String getApiVersion(){
            return this.apiVersion;
    }

    public A withApiVersion(String apiVersion){
            this.apiVersion=apiVersion; return (A) this;
    }

    public Boolean hasApiVersion(){
            return this.apiVersion != null;
    }

    public String getKind(){
            return this.kind;
    }

    public A withKind(String kind){
            this.kind=kind; return (A) this;
    }

    public Boolean hasKind(){
            return this.kind != null;
    }

    public String getName(){
            return this.name;
    }

    public A withName(String name){
            this.name=name; return (A) this;
    }

    public Boolean hasName(){
            return this.name != null;
    }

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

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

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

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

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

    public ExtensionsV1beta1DeploymentRollbackFluent.RollbackToNested withNewRollbackToLike(ExtensionsV1beta1RollbackConfig item){
            return new RollbackToNestedImpl(item);
    }

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

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

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

    public A addToUpdatedAnnotations(String key,String value){
            if(this.updatedAnnotations == null && key != null && value != null) { this.updatedAnnotations = new LinkedHashMap(); }
            if(key != null && value != null) {this.updatedAnnotations.put(key, value);} return (A)this;
    }

    public A addToUpdatedAnnotations(Map map){
            if(this.updatedAnnotations == null && map != null) { this.updatedAnnotations = new LinkedHashMap(); }
            if(map != null) { this.updatedAnnotations.putAll(map);} return (A)this;
    }

    public A removeFromUpdatedAnnotations(String key){
            if(this.updatedAnnotations == null) { return (A) this; }
            if(key != null && this.updatedAnnotations != null) {this.updatedAnnotations.remove(key);} return (A)this;
    }

    public A removeFromUpdatedAnnotations(Map map){
            if(this.updatedAnnotations == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.updatedAnnotations != null){this.updatedAnnotations.remove(key);}}} return (A)this;
    }

    public Map getUpdatedAnnotations(){
            return this.updatedAnnotations;
    }

    public A withUpdatedAnnotations(Map updatedAnnotations){
            if (updatedAnnotations == null) { this.updatedAnnotations =  null;} else {this.updatedAnnotations = new LinkedHashMap(updatedAnnotations);} return (A) this;
    }

    public Boolean hasUpdatedAnnotations(){
            return this.updatedAnnotations != 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;
            ExtensionsV1beta1DeploymentRollbackFluentImpl that = (ExtensionsV1beta1DeploymentRollbackFluentImpl) o;
            if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
            if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
            if (name != null ? !name.equals(that.name) :that.name != null) return false;
            if (rollbackTo != null ? !rollbackTo.equals(that.rollbackTo) :that.rollbackTo != null) return false;
            if (updatedAnnotations != null ? !updatedAnnotations.equals(that.updatedAnnotations) :that.updatedAnnotations != null) return false;
            return true;
    }


    public class RollbackToNestedImpl extends ExtensionsV1beta1RollbackConfigFluentImpl> implements ExtensionsV1beta1DeploymentRollbackFluent.RollbackToNested,io.kubernetes.client.fluent.Nested{

            private final ExtensionsV1beta1RollbackConfigBuilder builder;
    
            RollbackToNestedImpl(ExtensionsV1beta1RollbackConfig item){
                    this.builder = new ExtensionsV1beta1RollbackConfigBuilder(this, item);
            }
            RollbackToNestedImpl(){
                    this.builder = new ExtensionsV1beta1RollbackConfigBuilder(this);
            }
    
    public N and(){
            return (N) ExtensionsV1beta1DeploymentRollbackFluentImpl.this.withRollbackTo(builder.build());
    }
    public N endRollbackTo(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy