protected <K, V, S extends Enum<S>, T extends Enum<T>> OperationStatistic<T> createTranslatedStatistic(BaseStore<K, V> store, String statisticName, Map<T, Set<S>> translation, String targetName) { Class<S> outcomeType = getOutcomeType(translation); // If the original stat doesn't exist, we do not need to translate it if (StatsUtils.hasOperationStat(store, outcomeType, targetName)) { int tierHeight = getResourceType().getTierHeight(); OperationStatistic<T> stat = new MappedOperationStatistic<>(store, translation, statisticName, tierHeight, targetName, store .getStatisticsTag()); StatisticsManager.associate(stat).withParent(store); return stat; } return ZeroOperationStatistic.get(); }
protected <K, V, S extends Enum<S>, T extends Enum<T>> OperationStatistic<T> createTranslatedStatistic(BaseStore<K, V> store, String statisticName, Map<T, Set<S>> translation, String targetName) { Class<S> outcomeType = getOutcomeType(translation); // If the original stat doesn't exist, we do not need to translate it if (StatsUtils.hasOperationStat(store, outcomeType, targetName)) { int tierHeight = getResourceType().getTierHeight(); OperationStatistic<T> stat = new MappedOperationStatistic<>(store, translation, statisticName, tierHeight, targetName, store .getStatisticsTag()); StatisticsManager.associate(stat).withParent(store); return stat; } return ZeroOperationStatistic.get(); }