Package org.terracotta.statistics
Class SuppliedValueStatistic<T extends java.io.Serializable>
- java.lang.Object
-
- org.terracotta.statistics.SuppliedValueStatistic<T>
-
- All Implemented Interfaces:
ValueStatistic<T>
public class SuppliedValueStatistic<T extends java.io.Serializable> extends java.lang.Object implements ValueStatistic<T>
This class can be used to create aValueStatisticwith a specificStatisticTypewhich value is given by a providedSupplier
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<T>supplierprivate StatisticTypetype
-
Constructor Summary
Constructors Constructor Description SuppliedValueStatistic(StatisticType type, java.util.function.Supplier<T> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatisticTypetype()Tvalue()
-
-
-
Field Detail
-
supplier
private final java.util.function.Supplier<T extends java.io.Serializable> supplier
-
type
private final StatisticType type
-
-
Constructor Detail
-
SuppliedValueStatistic
public SuppliedValueStatistic(StatisticType type, java.util.function.Supplier<T> supplier)
-
-
Method Detail
-
value
public T value()
- Specified by:
valuein interfaceValueStatistic<T extends java.io.Serializable>- Returns:
- The current statistic value
-
type
public StatisticType type()
- Specified by:
typein interfaceValueStatistic<T extends java.io.Serializable>- Returns:
- The statistic type
-
-