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

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

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

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

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

    private io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder external;
    private io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder object;
    private io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder pods;
    private io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder resource;
    private String type;

    public MetricSpecFluentImpl() { 
    }


    public MetricSpecFluentImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.MetricSpec instance) { 
        this.withExternal(instance.getExternal()); 
        this.withObject(instance.getObject()); 
        this.withPods(instance.getPods()); 
        this.withResource(instance.getResource()); 
        this.withType(instance.getType()); 
    }


    
/**
 * This method has been deprecated, please use method buildExternal instead.
 * @return The buildable object.
 */
@Deprecated public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource getExternal() {
        return this.external!=null?this.external.build():null;
    }

    public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource buildExternal() {
        return this.external!=null?this.external.build():null;
    }

    public A withExternal(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource external) {
        _visitables.get("external").remove(this.external);
        if (external!=null){ this.external= new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder(external); _visitables.get("external").add(this.external);} return (A) this;
    }

    public Boolean hasExternal() {
        return this.external != null;
    }

    public MetricSpecFluent.ExternalNested withNewExternal() {
        return new ExternalNestedImpl();
    }

    public MetricSpecFluent.ExternalNested withNewExternalLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource item) {
        return new ExternalNestedImpl(item);
    }

    public MetricSpecFluent.ExternalNested editExternal() {
        return withNewExternalLike(getExternal());
    }

    public MetricSpecFluent.ExternalNested editOrNewExternal() {
        return withNewExternalLike(getExternal() != null ? getExternal(): new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder().build());
    }

    public MetricSpecFluent.ExternalNested editOrNewExternalLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource item) {
        return withNewExternalLike(getExternal() != null ? getExternal(): item);
    }

    
/**
 * This method has been deprecated, please use method buildObject instead.
 * @return The buildable object.
 */
@Deprecated public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource getObject() {
        return this.object!=null?this.object.build():null;
    }

    public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource buildObject() {
        return this.object!=null?this.object.build():null;
    }

    public A withObject(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource object) {
        _visitables.get("object").remove(this.object);
        if (object!=null){ this.object= new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder(object); _visitables.get("object").add(this.object);} return (A) this;
    }

    public Boolean hasObject() {
        return this.object != null;
    }

    public MetricSpecFluent.ObjectNested withNewObject() {
        return new ObjectNestedImpl();
    }

    public MetricSpecFluent.ObjectNested withNewObjectLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource item) {
        return new ObjectNestedImpl(item);
    }

    public MetricSpecFluent.ObjectNested editObject() {
        return withNewObjectLike(getObject());
    }

    public MetricSpecFluent.ObjectNested editOrNewObject() {
        return withNewObjectLike(getObject() != null ? getObject(): new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder().build());
    }

    public MetricSpecFluent.ObjectNested editOrNewObjectLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource item) {
        return withNewObjectLike(getObject() != null ? getObject(): item);
    }

    
/**
 * This method has been deprecated, please use method buildPods instead.
 * @return The buildable object.
 */
@Deprecated public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource getPods() {
        return this.pods!=null?this.pods.build():null;
    }

    public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource buildPods() {
        return this.pods!=null?this.pods.build():null;
    }

    public A withPods(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource pods) {
        _visitables.get("pods").remove(this.pods);
        if (pods!=null){ this.pods= new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder(pods); _visitables.get("pods").add(this.pods);} return (A) this;
    }

    public Boolean hasPods() {
        return this.pods != null;
    }

    public MetricSpecFluent.PodsNested withNewPods() {
        return new PodsNestedImpl();
    }

    public MetricSpecFluent.PodsNested withNewPodsLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource item) {
        return new PodsNestedImpl(item);
    }

    public MetricSpecFluent.PodsNested editPods() {
        return withNewPodsLike(getPods());
    }

    public MetricSpecFluent.PodsNested editOrNewPods() {
        return withNewPodsLike(getPods() != null ? getPods(): new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder().build());
    }

    public MetricSpecFluent.PodsNested editOrNewPodsLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource item) {
        return withNewPodsLike(getPods() != null ? getPods(): item);
    }

    
/**
 * This method has been deprecated, please use method buildResource instead.
 * @return The buildable object.
 */
@Deprecated public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource getResource() {
        return this.resource!=null?this.resource.build():null;
    }

    public io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource buildResource() {
        return this.resource!=null?this.resource.build():null;
    }

    public A withResource(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource resource) {
        _visitables.get("resource").remove(this.resource);
        if (resource!=null){ this.resource= new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder(resource); _visitables.get("resource").add(this.resource);} return (A) this;
    }

    public Boolean hasResource() {
        return this.resource != null;
    }

    public MetricSpecFluent.ResourceNested withNewResource() {
        return new ResourceNestedImpl();
    }

    public MetricSpecFluent.ResourceNested withNewResourceLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource item) {
        return new ResourceNestedImpl(item);
    }

    public MetricSpecFluent.ResourceNested editResource() {
        return withNewResourceLike(getResource());
    }

    public MetricSpecFluent.ResourceNested editOrNewResource() {
        return withNewResourceLike(getResource() != null ? getResource(): new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder().build());
    }

    public MetricSpecFluent.ResourceNested editOrNewResourceLike(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource item) {
        return withNewResourceLike(getResource() != null ? getResource(): item);
    }

    public String getType() {
        return this.type;
    }

    public A withType(String type) {
        this.type=type; return (A) this;
    }

    public Boolean hasType() {
        return this.type != null;
    }

    public A withNewType(String arg1) {
        return (A)withType(new String(arg1));
    }

    public A withNewType(StringBuilder arg1) {
        return (A)withType(new String(arg1));
    }

    public A withNewType(StringBuffer arg1) {
        return (A)withType(new String(arg1));
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MetricSpecFluentImpl that = (MetricSpecFluentImpl) o;
        if (external != null ? !external.equals(that.external) :that.external != null) return false;
        if (object != null ? !object.equals(that.object) :that.object != null) return false;
        if (pods != null ? !pods.equals(that.pods) :that.pods != null) return false;
        if (resource != null ? !resource.equals(that.resource) :that.resource != null) return false;
        if (type != null ? !type.equals(that.type) :that.type != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(external,  object,  pods,  resource,  type,  super.hashCode());
    }

    public class ExternalNestedImpl extends io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceFluentImpl> implements MetricSpecFluent.ExternalNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder builder;

        ExternalNestedImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSource item) {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder(this, item);
        }

        ExternalNestedImpl() {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ExternalMetricSourceBuilder(this);
        }

        public N and() {
             return (N) MetricSpecFluentImpl.this.withExternal(builder.build());
        }

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


    public class ObjectNestedImpl extends io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceFluentImpl> implements MetricSpecFluent.ObjectNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder builder;

        ObjectNestedImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSource item) {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder(this, item);
        }

        ObjectNestedImpl() {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ObjectMetricSourceBuilder(this);
        }

        public N and() {
             return (N) MetricSpecFluentImpl.this.withObject(builder.build());
        }

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


    public class PodsNestedImpl extends io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceFluentImpl> implements MetricSpecFluent.PodsNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder builder;

        PodsNestedImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSource item) {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder(this, item);
        }

        PodsNestedImpl() {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.PodsMetricSourceBuilder(this);
        }

        public N and() {
             return (N) MetricSpecFluentImpl.this.withPods(builder.build());
        }

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


    public class ResourceNestedImpl extends io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceFluentImpl> implements MetricSpecFluent.ResourceNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder builder;

        ResourceNestedImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource item) {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder(this, item);
        }

        ResourceNestedImpl() {
            this.builder = new io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceBuilder(this);
        }

        public N and() {
             return (N) MetricSpecFluentImpl.this.withResource(builder.build());
        }

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


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy