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

io.alauda.kubernetes.api.model.AffinityFluentImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import javax.validation.Valid;
import java.lang.Object;

public class AffinityFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements AffinityFluent{

    private NodeAffinityBuilder nodeAffinity;
    private PodAffinityBuilder podAffinity;
    private PodAntiAffinityBuilder podAntiAffinity;

    public AffinityFluentImpl(){
    }
    public AffinityFluentImpl(Affinity instance){
            this.withNodeAffinity(instance.getNodeAffinity()); 
            this.withPodAffinity(instance.getPodAffinity()); 
            this.withPodAntiAffinity(instance.getPodAntiAffinity()); 
    }

    
/**
 * This method has been deprecated, please use method buildNodeAffinity instead.
 */
@Deprecated public NodeAffinity getNodeAffinity(){
            return this.nodeAffinity!=null?this.nodeAffinity.build():null;
    }

    public NodeAffinity buildNodeAffinity(){
            return this.nodeAffinity!=null?this.nodeAffinity.build():null;
    }

    public A withNodeAffinity(NodeAffinity nodeAffinity){
            _visitables.remove(this.nodeAffinity);
            if (nodeAffinity!=null){ this.nodeAffinity= new NodeAffinityBuilder(nodeAffinity); _visitables.add(this.nodeAffinity);} return (A) this;
    }

    public Boolean hasNodeAffinity(){
            return this.nodeAffinity!=null;
    }

    public AffinityFluent.NodeAffinityNested withNewNodeAffinity(){
            return new NodeAffinityNestedImpl();
    }

    public AffinityFluent.NodeAffinityNested withNewNodeAffinityLike(NodeAffinity item){
            return new NodeAffinityNestedImpl(item);
    }

    public AffinityFluent.NodeAffinityNested editNodeAffinity(){
            return withNewNodeAffinityLike(getNodeAffinity());
    }

    public AffinityFluent.NodeAffinityNested editOrNewNodeAffinity(){
            return withNewNodeAffinityLike(getNodeAffinity() != null ? getNodeAffinity(): new NodeAffinityBuilder().build());
    }

    public AffinityFluent.NodeAffinityNested editOrNewNodeAffinityLike(NodeAffinity item){
            return withNewNodeAffinityLike(getNodeAffinity() != null ? getNodeAffinity(): item);
    }

    
/**
 * This method has been deprecated, please use method buildPodAffinity instead.
 */
@Deprecated public PodAffinity getPodAffinity(){
            return this.podAffinity!=null?this.podAffinity.build():null;
    }

    public PodAffinity buildPodAffinity(){
            return this.podAffinity!=null?this.podAffinity.build():null;
    }

    public A withPodAffinity(PodAffinity podAffinity){
            _visitables.remove(this.podAffinity);
            if (podAffinity!=null){ this.podAffinity= new PodAffinityBuilder(podAffinity); _visitables.add(this.podAffinity);} return (A) this;
    }

    public Boolean hasPodAffinity(){
            return this.podAffinity!=null;
    }

    public AffinityFluent.PodAffinityNested withNewPodAffinity(){
            return new PodAffinityNestedImpl();
    }

    public AffinityFluent.PodAffinityNested withNewPodAffinityLike(PodAffinity item){
            return new PodAffinityNestedImpl(item);
    }

    public AffinityFluent.PodAffinityNested editPodAffinity(){
            return withNewPodAffinityLike(getPodAffinity());
    }

    public AffinityFluent.PodAffinityNested editOrNewPodAffinity(){
            return withNewPodAffinityLike(getPodAffinity() != null ? getPodAffinity(): new PodAffinityBuilder().build());
    }

    public AffinityFluent.PodAffinityNested editOrNewPodAffinityLike(PodAffinity item){
            return withNewPodAffinityLike(getPodAffinity() != null ? getPodAffinity(): item);
    }

    
/**
 * This method has been deprecated, please use method buildPodAntiAffinity instead.
 */
@Deprecated public PodAntiAffinity getPodAntiAffinity(){
            return this.podAntiAffinity!=null?this.podAntiAffinity.build():null;
    }

    public PodAntiAffinity buildPodAntiAffinity(){
            return this.podAntiAffinity!=null?this.podAntiAffinity.build():null;
    }

    public A withPodAntiAffinity(PodAntiAffinity podAntiAffinity){
            _visitables.remove(this.podAntiAffinity);
            if (podAntiAffinity!=null){ this.podAntiAffinity= new PodAntiAffinityBuilder(podAntiAffinity); _visitables.add(this.podAntiAffinity);} return (A) this;
    }

    public Boolean hasPodAntiAffinity(){
            return this.podAntiAffinity!=null;
    }

    public AffinityFluent.PodAntiAffinityNested withNewPodAntiAffinity(){
            return new PodAntiAffinityNestedImpl();
    }

    public AffinityFluent.PodAntiAffinityNested withNewPodAntiAffinityLike(PodAntiAffinity item){
            return new PodAntiAffinityNestedImpl(item);
    }

    public AffinityFluent.PodAntiAffinityNested editPodAntiAffinity(){
            return withNewPodAntiAffinityLike(getPodAntiAffinity());
    }

    public AffinityFluent.PodAntiAffinityNested editOrNewPodAntiAffinity(){
            return withNewPodAntiAffinityLike(getPodAntiAffinity() != null ? getPodAntiAffinity(): new PodAntiAffinityBuilder().build());
    }

    public AffinityFluent.PodAntiAffinityNested editOrNewPodAntiAffinityLike(PodAntiAffinity item){
            return withNewPodAntiAffinityLike(getPodAntiAffinity() != null ? getPodAntiAffinity(): 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;
            AffinityFluentImpl that = (AffinityFluentImpl) o;
            if (nodeAffinity != null ? !nodeAffinity.equals(that.nodeAffinity) :that.nodeAffinity != null) return false;
            if (podAffinity != null ? !podAffinity.equals(that.podAffinity) :that.podAffinity != null) return false;
            if (podAntiAffinity != null ? !podAntiAffinity.equals(that.podAntiAffinity) :that.podAntiAffinity != null) return false;
            return true;
    }


    public class NodeAffinityNestedImpl extends NodeAffinityFluentImpl> implements AffinityFluent.NodeAffinityNested,io.alauda.kubernetes.api.builder.Nested{

            private final NodeAffinityBuilder builder;
    
            NodeAffinityNestedImpl(NodeAffinity item){
                    this.builder = new NodeAffinityBuilder(this, item);
            }
            NodeAffinityNestedImpl(){
                    this.builder = new NodeAffinityBuilder(this);
            }
    
    public N and(){
            return (N) AffinityFluentImpl.this.withNodeAffinity(builder.build());
    }
    public N endNodeAffinity(){
            return and();
    }

}
    public class PodAffinityNestedImpl extends PodAffinityFluentImpl> implements AffinityFluent.PodAffinityNested,io.alauda.kubernetes.api.builder.Nested{

            private final PodAffinityBuilder builder;
    
            PodAffinityNestedImpl(PodAffinity item){
                    this.builder = new PodAffinityBuilder(this, item);
            }
            PodAffinityNestedImpl(){
                    this.builder = new PodAffinityBuilder(this);
            }
    
    public N and(){
            return (N) AffinityFluentImpl.this.withPodAffinity(builder.build());
    }
    public N endPodAffinity(){
            return and();
    }

}
    public class PodAntiAffinityNestedImpl extends PodAntiAffinityFluentImpl> implements AffinityFluent.PodAntiAffinityNested,io.alauda.kubernetes.api.builder.Nested{

            private final PodAntiAffinityBuilder builder;
    
            PodAntiAffinityNestedImpl(PodAntiAffinity item){
                    this.builder = new PodAntiAffinityBuilder(this, item);
            }
            PodAntiAffinityNestedImpl(){
                    this.builder = new PodAntiAffinityBuilder(this);
            }
    
    public N and(){
            return (N) AffinityFluentImpl.this.withPodAntiAffinity(builder.build());
    }
    public N endPodAntiAffinity(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy