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

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

package io.kubernetes.client.models;

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

public class V2beta1ExternalMetricSourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta1ExternalMetricSourceFluent{

    private String metricName;
    private V1LabelSelectorBuilder metricSelector;
    private Quantity targetAverageValue;
    private Quantity targetValue;

    public V2beta1ExternalMetricSourceFluentImpl(){
    }
    public V2beta1ExternalMetricSourceFluentImpl(V2beta1ExternalMetricSource instance){
            this.withMetricName(instance.getMetricName());

            this.withMetricSelector(instance.getMetricSelector());

            this.withTargetAverageValue(instance.getTargetAverageValue());

            this.withTargetValue(instance.getTargetValue());

    }

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

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

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

    
/**
 * This method has been deprecated, please use method buildMetricSelector instead.
 */
@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.remove(this.metricSelector);
            if (metricSelector!=null){ this.metricSelector= new V1LabelSelectorBuilder(metricSelector); _visitables.add(this.metricSelector);} return (A) this;
    }

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

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

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

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

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

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

    public Quantity getTargetAverageValue(){
            return this.targetAverageValue;
    }

    public A withTargetAverageValue(Quantity targetAverageValue){
            this.targetAverageValue=targetAverageValue; return (A) this;
    }

    public Boolean hasTargetAverageValue(){
            return this.targetAverageValue != null;
    }

    public Quantity getTargetValue(){
            return this.targetValue;
    }

    public A withTargetValue(Quantity targetValue){
            this.targetValue=targetValue; return (A) this;
    }

    public Boolean hasTargetValue(){
            return this.targetValue != 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;
            V2beta1ExternalMetricSourceFluentImpl that = (V2beta1ExternalMetricSourceFluentImpl) o;
            if (metricName != null ? !metricName.equals(that.metricName) :that.metricName != null) return false;
            if (metricSelector != null ? !metricSelector.equals(that.metricSelector) :that.metricSelector != null) return false;
            if (targetAverageValue != null ? !targetAverageValue.equals(that.targetAverageValue) :that.targetAverageValue != null) return false;
            if (targetValue != null ? !targetValue.equals(that.targetValue) :that.targetValue != null) return false;
            return true;
    }


    public class MetricSelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V2beta1ExternalMetricSourceFluent.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) V2beta1ExternalMetricSourceFluentImpl.this.withMetricSelector(builder.build());
    }
    public N endMetricSelector(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy