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

io.kubernetes.client.openapi.models.V1WeightedPodAffinityTermFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.Integer;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class V1WeightedPodAffinityTermFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1WeightedPodAffinityTermFluent {

    private V1PodAffinityTermBuilder podAffinityTerm;
    private Integer weight;

    public V1WeightedPodAffinityTermFluentImpl() { 
    }


    public V1WeightedPodAffinityTermFluentImpl(V1WeightedPodAffinityTerm instance) { 
        this.withPodAffinityTerm(instance.getPodAffinityTerm());

        this.withWeight(instance.getWeight());

    }


    
/**
 * This method has been deprecated, please use method buildPodAffinityTerm instead.
 * @return The buildable object.
 */
@Deprecated public V1PodAffinityTerm getPodAffinityTerm() {
        return this.podAffinityTerm!=null?this.podAffinityTerm.build():null;
    }

    public V1PodAffinityTerm buildPodAffinityTerm() {
        return this.podAffinityTerm!=null?this.podAffinityTerm.build():null;
    }

    public A withPodAffinityTerm(V1PodAffinityTerm podAffinityTerm) {
        _visitables.get("podAffinityTerm").remove(this.podAffinityTerm);
        if (podAffinityTerm!=null){ this.podAffinityTerm= new V1PodAffinityTermBuilder(podAffinityTerm); _visitables.get("podAffinityTerm").add(this.podAffinityTerm);} return (A) this;
    }

    public Boolean hasPodAffinityTerm() {
        return this.podAffinityTerm != null;
    }

    public V1WeightedPodAffinityTermFluent.PodAffinityTermNested withNewPodAffinityTerm() {
        return new PodAffinityTermNestedImpl();
    }

    public V1WeightedPodAffinityTermFluent.PodAffinityTermNested withNewPodAffinityTermLike(V1PodAffinityTerm item) {
        return new PodAffinityTermNestedImpl(item);
    }

    public V1WeightedPodAffinityTermFluent.PodAffinityTermNested editPodAffinityTerm() {
        return withNewPodAffinityTermLike(getPodAffinityTerm());
    }

    public V1WeightedPodAffinityTermFluent.PodAffinityTermNested editOrNewPodAffinityTerm() {
        return withNewPodAffinityTermLike(getPodAffinityTerm() != null ? getPodAffinityTerm(): new V1PodAffinityTermBuilder().build());
    }

    public V1WeightedPodAffinityTermFluent.PodAffinityTermNested editOrNewPodAffinityTermLike(V1PodAffinityTerm item) {
        return withNewPodAffinityTermLike(getPodAffinityTerm() != null ? getPodAffinityTerm(): item);
    }

    public Integer getWeight() {
        return this.weight;
    }

    public A withWeight(Integer weight) {
        this.weight=weight; return (A) this;
    }

    public Boolean hasWeight() {
        return this.weight != null;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1WeightedPodAffinityTermFluentImpl that = (V1WeightedPodAffinityTermFluentImpl) o;
        if (podAffinityTerm != null ? !podAffinityTerm.equals(that.podAffinityTerm) :that.podAffinityTerm != null) return false;
        if (weight != null ? !weight.equals(that.weight) :that.weight != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(podAffinityTerm,  weight,  super.hashCode());
    }

    public class PodAffinityTermNestedImpl extends V1PodAffinityTermFluentImpl> implements V1WeightedPodAffinityTermFluent.PodAffinityTermNested,io.kubernetes.client.fluent.Nested {
        private final V1PodAffinityTermBuilder builder;

        PodAffinityTermNestedImpl(V1PodAffinityTerm item) {
            this.builder = new V1PodAffinityTermBuilder(this, item);
        }

        PodAffinityTermNestedImpl() {
            this.builder = new V1PodAffinityTermBuilder(this);
        }

        public N and() {
             return (N) V1WeightedPodAffinityTermFluentImpl.this.withPodAffinityTerm(builder.build());
        }

        public N endPodAffinityTerm() {
             return and();
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy