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

com.ringcentral.platform.metrics.var.stringVar.AbstractStringVar Maven / Gradle / Ivy

package com.ringcentral.platform.metrics.var.stringVar;

import com.ringcentral.platform.metrics.labels.LabelValue;
import com.ringcentral.platform.metrics.measurables.Measurable;
import com.ringcentral.platform.metrics.names.MetricName;
import com.ringcentral.platform.metrics.var.AbstractVar;
import com.ringcentral.platform.metrics.var.configs.VarConfig;

import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Supplier;

public class AbstractStringVar extends AbstractVar implements StringVar {

    public interface StringVarInstanceMaker extends InstanceMaker {}

    public static class DefaultStringVarInstanceMaker implements StringVarInstanceMaker {

        public static DefaultStringVarInstanceMaker INSTANCE = new DefaultStringVarInstanceMaker();

        @Override
        public StringVarInstance makeInstance(
            MetricName name,
            List labelValues,
            boolean totalInstance,
            boolean labeledMetricTotalInstance,
            boolean nonDecreasing,
            Measurable valueMeasurable,
            Supplier valueSupplier) {

            return new DefaultStringVarInstance(
                name,
                labelValues,
                totalInstance,
                labeledMetricTotalInstance,
                nonDecreasing,
                valueMeasurable,
                valueSupplier);
        }
    }

    protected AbstractStringVar(
        MetricName name,
        VarConfig config,
        Measurable valueMeasurable,
        Supplier valueSupplier,
        ScheduledExecutorService executor) {

        super(
            name,
            config,
            valueMeasurable,
            valueSupplier,
            DefaultStringVarInstanceMaker.INSTANCE,
            executor);
    }

    protected AbstractStringVar(
        MetricName name,
        VarConfig config,
        Measurable valueMeasurable,
        Supplier valueSupplier,
        InstanceMaker instanceMaker,
        ScheduledExecutorService executor) {

        super(
            name,
            config,
            valueMeasurable,
            valueSupplier,
            instanceMaker,
            executor);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy