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

org.infinispan.commons.stat.BaseSetterMetricInfo Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev03
Show newest version
package org.infinispan.commons.stat;

import java.util.Map;
import java.util.Objects;
import java.util.function.BiConsumer;

/**
 * Extends {@link BaseMetricInfo} with a consumer, usually a target instance and the tracker to set.
 *
 * @since 15.0
 */
abstract class BaseSetterMetricInfo extends BaseMetricInfo {

   private final BiConsumer setter;

   BaseSetterMetricInfo(String name, String description, Map map, BiConsumer setter) {
      super(name, description, map);
      this.setter = Objects.requireNonNull(setter);
   }

   public final void accept(O targetInstance, M metricTracker) {
      setter.accept(targetInstance, metricTracker);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy