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

annotations.io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSourceFluentImpl 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.StringBuffer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

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

    private String name;
    private MetricTargetBuilder target;

    public ResourceMetricSourceFluentImpl(){
    }
    public ResourceMetricSourceFluentImpl(io.fabric8.kubernetes.api.model.autoscaling.v2beta2.ResourceMetricSource instance){
            this.withName(instance.getName()); 
            this.withTarget(instance.getTarget()); 
    }

    public String getName(){
            return this.name;
    }

    public A withName(String name){
            this.name=name; return (A) this;
    }

    public Boolean hasName(){
            return this.name != null;
    }

    public A withNewName(String arg1){
            return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuilder arg1){
            return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuffer arg1){
            return (A)withName(new String(arg1));
    }

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

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

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

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

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

    public ResourceMetricSourceFluent.TargetNested withNewTargetLike(MetricTarget item){
            return new TargetNestedImpl(item);
    }

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

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

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

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


    public class TargetNestedImpl extends MetricTargetFluentImpl> implements ResourceMetricSourceFluent.TargetNested,io.fabric8.kubernetes.api.builder.Nested{

            private final MetricTargetBuilder builder;
    
            TargetNestedImpl(MetricTarget item){
                    this.builder = new MetricTargetBuilder(this, item);
            }
            TargetNestedImpl(){
                    this.builder = new MetricTargetBuilder(this);
            }
    
    public N and(){
            return (N) ResourceMetricSourceFluentImpl.this.withTarget(builder.build());
    }
    public N endTarget(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy