io.github.honoriuss.blossom.BlossomParameterRegistryImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tracking-blossom Show documentation
Show all versions of tracking-blossom Show documentation
Track your app nice and convenient
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;
}
}