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

com.ringcentral.platform.metrics.infoProviders.DefaultConcurrentMetricNamedInfoProvider Maven / Gradle / Ivy

package com.ringcentral.platform.metrics.infoProviders;

import com.ringcentral.platform.metrics.predicates.MetricNamedPredicate;

import java.util.HashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Predicate;

public class DefaultConcurrentMetricNamedInfoProvider
    extends DefaultMetricNamedInfoProvider
    implements ConcurrentMetricNamedInfoProvider {

    public DefaultConcurrentMetricNamedInfoProvider() {
        super(new CopyOnWriteArrayList<>(), new HashMap<>());
    }

    @Override
    public synchronized DefaultConcurrentMetricNamedInfoProvider addInfo(String key, MetricNamedPredicate predicate, I info) {
        super.addInfo(key, predicate, info);
        return this;
    }

    @Override
    public synchronized DefaultConcurrentMetricNamedInfoProvider removeInfo(String key) {
        super.removeInfo(key);
        return this;
    }

    @Override
    public synchronized DefaultConcurrentMetricNamedInfoProvider removeInfos(Predicate keyPredicate) {
        super.removeInfos(keyPredicate);
        return this;
    }
}