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

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

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

import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import io.kubernetes.client.custom.Quantity;
import java.lang.String;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class V2beta1ExternalMetricStatusFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta1ExternalMetricStatusFluent {

    private Quantity currentAverageValue;
    private Quantity currentValue;
    private String metricName;
    private V1LabelSelectorBuilder metricSelector;

    public V2beta1ExternalMetricStatusFluentImpl() { 
    }


    public V2beta1ExternalMetricStatusFluentImpl(V2beta1ExternalMetricStatus instance) { 
        this.withCurrentAverageValue(instance.getCurrentAverageValue());

        this.withCurrentValue(instance.getCurrentValue());

        this.withMetricName(instance.getMetricName());

        this.withMetricSelector(instance.getMetricSelector());

    }


    public Quantity getCurrentAverageValue() {
        return this.currentAverageValue;
    }

    public A withCurrentAverageValue(Quantity currentAverageValue) {
        this.currentAverageValue=currentAverageValue; return (A) this;
    }

    public Boolean hasCurrentAverageValue() {
        return this.currentAverageValue != null;
    }

    public A withNewCurrentAverageValue(final String value) {
        return (A)withCurrentAverageValue(new Quantity(value));
    }

    public Quantity getCurrentValue() {
        return this.currentValue;
    }

    public A withCurrentValue(Quantity currentValue) {
        this.currentValue=currentValue; return (A) this;
    }

    public Boolean hasCurrentValue() {
        return this.currentValue != null;
    }

    public A withNewCurrentValue(final String value) {
        return (A)withCurrentValue(new Quantity(value));
    }

    public String getMetricName() {
        return this.metricName;
    }

    public A withMetricName(String metricName) {
        this.metricName=metricName; return (A) this;
    }

    public Boolean hasMetricName() {
        return this.metricName != null;
    }

    public A withNewMetricName(String arg1) {
        return (A)withMetricName(new String(arg1));
    }

    public A withNewMetricName(StringBuilder arg1) {
        return (A)withMetricName(new String(arg1));
    }

    public A withNewMetricName(StringBuffer arg1) {
        return (A)withMetricName(new String(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildMetricSelector instead.
 * @return The buildable object.
 */
@Deprecated public V1LabelSelector getMetricSelector() {
        return this.metricSelector!=null?this.metricSelector.build():null;
    }

    public V1LabelSelector buildMetricSelector() {
        return this.metricSelector!=null?this.metricSelector.build():null;
    }

    public A withMetricSelector(V1LabelSelector metricSelector) {
        _visitables.get("metricSelector").remove(this.metricSelector);
        if (metricSelector!=null){ this.metricSelector= new V1LabelSelectorBuilder(metricSelector); _visitables.get("metricSelector").add(this.metricSelector);} return (A) this;
    }

    public Boolean hasMetricSelector() {
        return this.metricSelector != null;
    }

    public V2beta1ExternalMetricStatusFluent.MetricSelectorNested withNewMetricSelector() {
        return new MetricSelectorNestedImpl();
    }

    public V2beta1ExternalMetricStatusFluent.MetricSelectorNested withNewMetricSelectorLike(V1LabelSelector item) {
        return new MetricSelectorNestedImpl(item);
    }

    public V2beta1ExternalMetricStatusFluent.MetricSelectorNested editMetricSelector() {
        return withNewMetricSelectorLike(getMetricSelector());
    }

    public V2beta1ExternalMetricStatusFluent.MetricSelectorNested editOrNewMetricSelector() {
        return withNewMetricSelectorLike(getMetricSelector() != null ? getMetricSelector(): new V1LabelSelectorBuilder().build());
    }

    public V2beta1ExternalMetricStatusFluent.MetricSelectorNested editOrNewMetricSelectorLike(V1LabelSelector item) {
        return withNewMetricSelectorLike(getMetricSelector() != null ? getMetricSelector(): item);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V2beta1ExternalMetricStatusFluentImpl that = (V2beta1ExternalMetricStatusFluentImpl) o;
        if (currentAverageValue != null ? !currentAverageValue.equals(that.currentAverageValue) :that.currentAverageValue != null) return false;
        if (currentValue != null ? !currentValue.equals(that.currentValue) :that.currentValue != null) return false;
        if (metricName != null ? !metricName.equals(that.metricName) :that.metricName != null) return false;
        if (metricSelector != null ? !metricSelector.equals(that.metricSelector) :that.metricSelector != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(currentAverageValue,  currentValue,  metricName,  metricSelector,  super.hashCode());
    }

    public class MetricSelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V2beta1ExternalMetricStatusFluent.MetricSelectorNested,io.kubernetes.client.fluent.Nested {
        private final V1LabelSelectorBuilder builder;

        MetricSelectorNestedImpl(V1LabelSelector item) {
            this.builder = new V1LabelSelectorBuilder(this, item);
        }

        MetricSelectorNestedImpl() {
            this.builder = new V1LabelSelectorBuilder(this);
        }

        public N and() {
             return (N) V2beta1ExternalMetricStatusFluentImpl.this.withMetricSelector(builder.build());
        }

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


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy