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

me.snowdrop.istio.adapter.prometheus.PrometheusBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.adapter.prometheus;

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

public class PrometheusBuilder extends PrometheusFluentImpl implements VisitableBuilder{

    PrometheusFluent fluent;
    Boolean validationEnabled;

    public PrometheusBuilder(){
            this(true);
    }
    public PrometheusBuilder(Boolean validationEnabled){
            this(new Prometheus(), validationEnabled);
    }
    public PrometheusBuilder(PrometheusFluent fluent){
            this(fluent, true);
    }
    public PrometheusBuilder(PrometheusFluent fluent,Boolean validationEnabled){
            this(fluent, new Prometheus(), validationEnabled);
    }
    public PrometheusBuilder(PrometheusFluent fluent,Prometheus instance){
            this(fluent, instance, true);
    }
    public PrometheusBuilder(PrometheusFluent fluent,Prometheus instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withMetrics(instance.getMetrics()); 
            this.validationEnabled = validationEnabled; 
    }
    public PrometheusBuilder(Prometheus instance){
            this(instance,true);
    }
    public PrometheusBuilder(Prometheus instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withMetrics(instance.getMetrics()); 
            this.validationEnabled = validationEnabled; 
    }

    public Prometheus build(){
            Prometheus buildable = new Prometheus(fluent.getMetrics());
            io.fabric8.kubernetes.api.builder.ValidationUtils.validate(buildable);
            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;
            PrometheusBuilder that = (PrometheusBuilder) 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;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy