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

io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricStatusFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model.autoscaling.v2beta2;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class ExternalMetricStatusFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricStatusFluent{

    private MetricValueStatusBuilder current;
    private MetricIdentifierBuilder metric;

    public ExternalMetricStatusFluentImpl(){
    }
    public ExternalMetricStatusFluentImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricStatus instance){
            this.withCurrent(instance.getCurrent()); 
            this.withMetric(instance.getMetric()); 
    }

    
/**
 * This method has been deprecated, please use method buildCurrent instead.
 * @return The buildable object.
 */
@Deprecated public MetricValueStatus getCurrent(){
            return this.current!=null?this.current.build():null;
    }

    public MetricValueStatus buildCurrent(){
            return this.current!=null?this.current.build():null;
    }

    public A withCurrent(MetricValueStatus current){
            _visitables.get("current").remove(this.current);
            if (current!=null){ this.current= new MetricValueStatusBuilder(current); _visitables.get("current").add(this.current);} return (A) this;
    }

    public Boolean hasCurrent(){
            return this.current != null;
    }

    public ExternalMetricStatusFluent.CurrentNested withNewCurrent(){
            return new CurrentNestedImpl();
    }

    public ExternalMetricStatusFluent.CurrentNested withNewCurrentLike(MetricValueStatus item){
            return new CurrentNestedImpl(item);
    }

    public ExternalMetricStatusFluent.CurrentNested editCurrent(){
            return withNewCurrentLike(getCurrent());
    }

    public ExternalMetricStatusFluent.CurrentNested editOrNewCurrent(){
            return withNewCurrentLike(getCurrent() != null ? getCurrent(): new MetricValueStatusBuilder().build());
    }

    public ExternalMetricStatusFluent.CurrentNested editOrNewCurrentLike(MetricValueStatus item){
            return withNewCurrentLike(getCurrent() != null ? getCurrent(): item);
    }

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

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

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

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

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

    public ExternalMetricStatusFluent.MetricNested withNewMetricLike(MetricIdentifier item){
            return new MetricNestedImpl(item);
    }

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

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

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

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


    public class CurrentNestedImpl extends MetricValueStatusFluentImpl> implements ExternalMetricStatusFluent.CurrentNested,io.fabric8.kubernetes.api.builder.Nested{

            private final MetricValueStatusBuilder builder;
    
            CurrentNestedImpl(MetricValueStatus item){
                    this.builder = new MetricValueStatusBuilder(this, item);
            }
            CurrentNestedImpl(){
                    this.builder = new MetricValueStatusBuilder(this);
            }
    
    public N and(){
            return (N) ExternalMetricStatusFluentImpl.this.withCurrent(builder.build());
    }
    public N endCurrent(){
            return and();
    }

}
    public class MetricNestedImpl extends MetricIdentifierFluentImpl> implements ExternalMetricStatusFluent.MetricNested,io.fabric8.kubernetes.api.builder.Nested{

            private final MetricIdentifierBuilder builder;
    
            MetricNestedImpl(MetricIdentifier item){
                    this.builder = new MetricIdentifierBuilder(this, item);
            }
            MetricNestedImpl(){
                    this.builder = new MetricIdentifierBuilder(this);
            }
    
    public N and(){
            return (N) ExternalMetricStatusFluentImpl.this.withMetric(builder.build());
    }
    public N endMetric(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy