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

com.ringcentral.platform.metrics.samples.DefaultInstanceSampleSpecModsProvider Maven / Gradle / Ivy

package com.ringcentral.platform.metrics.samples;

import com.ringcentral.platform.metrics.infoProviders.MaskTreeMetricNamedInfoProvider;
import com.ringcentral.platform.metrics.infoProviders.PredicativeMetricNamedInfoProvider;
import com.ringcentral.platform.metrics.names.MetricNamed;
import com.ringcentral.platform.metrics.predicates.MetricNamedPredicate;

import java.util.List;
import java.util.function.Predicate;

public class DefaultInstanceSampleSpecModsProvider implements SpecModsProvider<
    InstanceSampleSpecProvider,
    DefaultInstanceSampleSpecModsProvider> {

    private final PredicativeMetricNamedInfoProvider> parent;

    public DefaultInstanceSampleSpecModsProvider() {
        this(new MaskTreeMetricNamedInfoProvider<>());
    }

    public DefaultInstanceSampleSpecModsProvider(PredicativeMetricNamedInfoProvider> parent) {
        this.parent = parent;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DefaultInstanceSampleSpecModsProvider addInfo(
        String key,
        MetricNamedPredicate predicate,
        InstanceSampleSpecProvider info) {

        parent.addInfo(key, predicate, info);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DefaultInstanceSampleSpecModsProvider removeInfo(String key) {
        parent.removeInfo(key);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DefaultInstanceSampleSpecModsProvider removeInfos(Predicate keyPredicate) {
        parent.removeInfos(keyPredicate);
        return this;
    }

    @Override
    public List> infosFor(MetricNamed named) {
        return parent.infosFor(named);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy