java.lang.Object
org.sentrysoftware.metricshub.engine.telemetry.metric.AbstractMetric
Direct Known Subclasses:
NumberMetric, StateSetMetric

public abstract class AbstractMetric extends Object
An abstract base class representing a telemetry metric. Concrete implementations must extend this class and provide specific behavior for handling different types of metrics.
  • Method Details

    • save

      public void save()
      Set the collect time as previous collect time
    • isUpdated

      public boolean isUpdated()
      Whether the metric is updated or not
      Returns:
      true if the collect time is different from the previous collect time otherwise false
    • getType

      public abstract String getType()
      Get the metric type as String value
      Returns:
      String value
    • getValue

      public abstract <T> T getValue()
      Gets the value of the metric.
      Type Parameters:
      T - The type of the metric value.
      Returns:
      The value of the metric.