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

io.kubernetes.client.openapi.models.V2beta2PodsMetricSourceFluentImpl 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.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class V2beta2PodsMetricSourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta2PodsMetricSourceFluent {

    private V2beta2MetricIdentifierBuilder metric;
    private V2beta2MetricTargetBuilder target;

    public V2beta2PodsMetricSourceFluentImpl() { 
    }


    public V2beta2PodsMetricSourceFluentImpl(V2beta2PodsMetricSource instance) { 
        this.withMetric(instance.getMetric());

        this.withTarget(instance.getTarget());

    }


    
/**
 * This method has been deprecated, please use method buildMetric instead.
 * @return The buildable object.
 */
@Deprecated public V2beta2MetricIdentifier getMetric() {
        return this.metric!=null?this.metric.build():null;
    }

    public V2beta2MetricIdentifier buildMetric() {
        return this.metric!=null?this.metric.build():null;
    }

    public A withMetric(V2beta2MetricIdentifier metric) {
        _visitables.get("metric").remove(this.metric);
        if (metric!=null){ this.metric= new V2beta2MetricIdentifierBuilder(metric); _visitables.get("metric").add(this.metric);} return (A) this;
    }

    public Boolean hasMetric() {
        return this.metric != null;
    }

    public V2beta2PodsMetricSourceFluent.MetricNested withNewMetric() {
        return new MetricNestedImpl();
    }

    public V2beta2PodsMetricSourceFluent.MetricNested withNewMetricLike(V2beta2MetricIdentifier item) {
        return new MetricNestedImpl(item);
    }

    public V2beta2PodsMetricSourceFluent.MetricNested editMetric() {
        return withNewMetricLike(getMetric());
    }

    public V2beta2PodsMetricSourceFluent.MetricNested editOrNewMetric() {
        return withNewMetricLike(getMetric() != null ? getMetric(): new V2beta2MetricIdentifierBuilder().build());
    }

    public V2beta2PodsMetricSourceFluent.MetricNested editOrNewMetricLike(V2beta2MetricIdentifier item) {
        return withNewMetricLike(getMetric() != null ? getMetric(): item);
    }

    
/**
 * This method has been deprecated, please use method buildTarget instead.
 * @return The buildable object.
 */
@Deprecated public V2beta2MetricTarget getTarget() {
        return this.target!=null?this.target.build():null;
    }

    public V2beta2MetricTarget buildTarget() {
        return this.target!=null?this.target.build():null;
    }

    public A withTarget(V2beta2MetricTarget target) {
        _visitables.get("target").remove(this.target);
        if (target!=null){ this.target= new V2beta2MetricTargetBuilder(target); _visitables.get("target").add(this.target);} return (A) this;
    }

    public Boolean hasTarget() {
        return this.target != null;
    }

    public V2beta2PodsMetricSourceFluent.TargetNested withNewTarget() {
        return new TargetNestedImpl();
    }

    public V2beta2PodsMetricSourceFluent.TargetNested withNewTargetLike(V2beta2MetricTarget item) {
        return new TargetNestedImpl(item);
    }

    public V2beta2PodsMetricSourceFluent.TargetNested editTarget() {
        return withNewTargetLike(getTarget());
    }

    public V2beta2PodsMetricSourceFluent.TargetNested editOrNewTarget() {
        return withNewTargetLike(getTarget() != null ? getTarget(): new V2beta2MetricTargetBuilder().build());
    }

    public V2beta2PodsMetricSourceFluent.TargetNested editOrNewTargetLike(V2beta2MetricTarget item) {
        return withNewTargetLike(getTarget() != null ? getTarget(): item);
    }

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

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

    public class MetricNestedImpl extends V2beta2MetricIdentifierFluentImpl> implements V2beta2PodsMetricSourceFluent.MetricNested,io.kubernetes.client.fluent.Nested {
        private final V2beta2MetricIdentifierBuilder builder;

        MetricNestedImpl(V2beta2MetricIdentifier item) {
            this.builder = new V2beta2MetricIdentifierBuilder(this, item);
        }

        MetricNestedImpl() {
            this.builder = new V2beta2MetricIdentifierBuilder(this);
        }

        public N and() {
             return (N) V2beta2PodsMetricSourceFluentImpl.this.withMetric(builder.build());
        }

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


    public class TargetNestedImpl extends V2beta2MetricTargetFluentImpl> implements V2beta2PodsMetricSourceFluent.TargetNested,io.kubernetes.client.fluent.Nested {
        private final V2beta2MetricTargetBuilder builder;

        TargetNestedImpl(V2beta2MetricTarget item) {
            this.builder = new V2beta2MetricTargetBuilder(this, item);
        }

        TargetNestedImpl() {
            this.builder = new V2beta2MetricTargetBuilder(this);
        }

        public N and() {
             return (N) V2beta2PodsMetricSourceFluentImpl.this.withTarget(builder.build());
        }

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


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy