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

io.kubernetes.client.openapi.models.V2beta1ObjectMetricSourceFluentImpl 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 V2beta1ObjectMetricSourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta1ObjectMetricSourceFluent {

    private Quantity averageValue;
    private String metricName;
    private V1LabelSelectorBuilder selector;
    private V2beta1CrossVersionObjectReferenceBuilder target;
    private Quantity targetValue;

    public V2beta1ObjectMetricSourceFluentImpl() { 
    }


    public V2beta1ObjectMetricSourceFluentImpl(V2beta1ObjectMetricSource instance) { 
        this.withAverageValue(instance.getAverageValue());

        this.withMetricName(instance.getMetricName());

        this.withSelector(instance.getSelector());

        this.withTarget(instance.getTarget());

        this.withTargetValue(instance.getTargetValue());

    }


    public Quantity getAverageValue() {
        return this.averageValue;
    }

    public A withAverageValue(Quantity averageValue) {
        this.averageValue=averageValue; return (A) this;
    }

    public Boolean hasAverageValue() {
        return this.averageValue != null;
    }

    public A withNewAverageValue(final String value) {
        return (A)withAverageValue(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 buildSelector instead.
 * @return The buildable object.
 */
@Deprecated public V1LabelSelector getSelector() {
        return this.selector!=null?this.selector.build():null;
    }

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

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

    public Boolean hasSelector() {
        return this.selector != null;
    }

    public V2beta1ObjectMetricSourceFluent.SelectorNested withNewSelector() {
        return new SelectorNestedImpl();
    }

    public V2beta1ObjectMetricSourceFluent.SelectorNested withNewSelectorLike(V1LabelSelector item) {
        return new SelectorNestedImpl(item);
    }

    public V2beta1ObjectMetricSourceFluent.SelectorNested editSelector() {
        return withNewSelectorLike(getSelector());
    }

    public V2beta1ObjectMetricSourceFluent.SelectorNested editOrNewSelector() {
        return withNewSelectorLike(getSelector() != null ? getSelector(): new V1LabelSelectorBuilder().build());
    }

    public V2beta1ObjectMetricSourceFluent.SelectorNested editOrNewSelectorLike(V1LabelSelector item) {
        return withNewSelectorLike(getSelector() != null ? getSelector(): item);
    }

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

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

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

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

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

    public V2beta1ObjectMetricSourceFluent.TargetNested withNewTargetLike(V2beta1CrossVersionObjectReference item) {
        return new TargetNestedImpl(item);
    }

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

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

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

    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 A withNewTargetValue(final String value) {
        return (A)withTargetValue(new Quantity(value));
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V2beta1ObjectMetricSourceFluentImpl that = (V2beta1ObjectMetricSourceFluentImpl) o;
        if (averageValue != null ? !averageValue.equals(that.averageValue) :that.averageValue != null) return false;
        if (metricName != null ? !metricName.equals(that.metricName) :that.metricName != null) return false;
        if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
        if (target != null ? !target.equals(that.target) :that.target != null) return false;
        if (targetValue != null ? !targetValue.equals(that.targetValue) :that.targetValue != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(averageValue,  metricName,  selector,  target,  targetValue,  super.hashCode());
    }

    public class SelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V2beta1ObjectMetricSourceFluent.SelectorNested,io.kubernetes.client.fluent.Nested {
        private final V1LabelSelectorBuilder builder;

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

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

        public N and() {
             return (N) V2beta1ObjectMetricSourceFluentImpl.this.withSelector(builder.build());
        }

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


    public class TargetNestedImpl extends V2beta1CrossVersionObjectReferenceFluentImpl> implements V2beta1ObjectMetricSourceFluent.TargetNested,io.kubernetes.client.fluent.Nested {
        private final V2beta1CrossVersionObjectReferenceBuilder builder;

        TargetNestedImpl(V2beta1CrossVersionObjectReference item) {
            this.builder = new V2beta1CrossVersionObjectReferenceBuilder(this, item);
        }

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

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

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


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy