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

io.fabric8.kubernetes.api.model.autoscaling.v2beta1.ObjectMetricSourceBuilder Maven / Gradle / Ivy

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

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class ObjectMetricSourceBuilder extends ObjectMetricSourceFluentImpl implements VisitableBuilder {

    ObjectMetricSourceFluent fluent;
    Boolean validationEnabled;

    public ObjectMetricSourceBuilder() { 
        this(true);
    }


    public ObjectMetricSourceBuilder(Boolean validationEnabled) { 
        this(new ObjectMetricSource(), validationEnabled);
    }


    public ObjectMetricSourceBuilder(ObjectMetricSourceFluent fluent) { 
        this(fluent, true);
    }


    public ObjectMetricSourceBuilder(ObjectMetricSourceFluent fluent,Boolean validationEnabled) { 
        this(fluent, new ObjectMetricSource(), validationEnabled);
    }


    public ObjectMetricSourceBuilder(ObjectMetricSourceFluent fluent,ObjectMetricSource instance) { 
        this(fluent, instance, true);
    }


    public ObjectMetricSourceBuilder(ObjectMetricSourceFluent fluent,ObjectMetricSource instance,Boolean validationEnabled) { 
        this.fluent = fluent; 
        fluent.withAverageValue(instance.getAverageValue()); 
        fluent.withMetricName(instance.getMetricName()); 
        fluent.withSelector(instance.getSelector()); 
        fluent.withTarget(instance.getTarget()); 
        fluent.withTargetValue(instance.getTargetValue()); 
        this.validationEnabled = validationEnabled; 
    }


    public ObjectMetricSourceBuilder(ObjectMetricSource instance) { 
        this(instance,true);
    }


    public ObjectMetricSourceBuilder(ObjectMetricSource instance,Boolean validationEnabled) { 
        this.fluent = this; 
        this.withAverageValue(instance.getAverageValue()); 
        this.withMetricName(instance.getMetricName()); 
        this.withSelector(instance.getSelector()); 
        this.withTarget(instance.getTarget()); 
        this.withTargetValue(instance.getTargetValue()); 
        this.validationEnabled = validationEnabled; 
    }


    public ObjectMetricSource build() {
        ObjectMetricSource buildable = new ObjectMetricSource(fluent.getAverageValue(),fluent.getMetricName(),fluent.getSelector(),fluent.getTarget(),fluent.getTargetValue());
        return buildable;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        ObjectMetricSourceBuilder that = (ObjectMetricSourceBuilder) o;
        if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;

        if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(fluent,  validationEnabled,  super.hashCode());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy