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

io.github.honoriuss.blossom.BlossomParameterRegistryImpl Maven / Gradle / Ivy

There is a newer version: 0.2.6
Show newest version
package io.github.honoriuss.blossom;

import io.github.honoriuss.blossom.interfaces.ITrackingParameterProvider;
import io.github.honoriuss.blossom.interfaces.ITrackingParameterRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

class BlossomParameterRegistryImpl implements ITrackingParameterRegistry {
    private final Logger logger = LoggerFactory.getLogger(BlossomParameterRegistryImpl.class);
    private final List parameterProviderList;

    BlossomParameterRegistryImpl(List parameterProviderList) {
        this.parameterProviderList = parameterProviderList;

        logger.info("{} parameter provider registered.", parameterProviderList.size());
    }

    @Override
    @Deprecated
    public void register(ITrackingParameterProvider trackingParameterProvider) {
        if (parameterProviderList.contains(trackingParameterProvider)) {
            logger.info("Tracking parameter provider: {} is already registered.", trackingParameterProvider.getClass().getName());
            return;
        }
        logger.info("Registering tracking parameter provider: {}", trackingParameterProvider.getClass().getName());
        parameterProviderList.add(trackingParameterProvider);
    }

    @Override
    public List getTrackingParameterProviders() {
        return parameterProviderList;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy