Class TimeGuard.TimeData

java.lang.Object
com.igormaznitsa.meta.common.utils.TimeGuard.TimeData
All Implemented Interfaces:
Serializable
Enclosing class:
TimeGuard

public static final class TimeGuard.TimeData extends Object implements Serializable
Data container for time watching action.
Since:
1.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • stackDepth

      private final int stackDepth
      Contains detected stack depth for creation.
      Since:
      1.0
    • maxAllowedDelayInMilliseconds

      private final long maxAllowedDelayInMilliseconds
      Max allowed time delay in milliseconds.
      Since:
      1.0
    • creationTimeInMilliseconds

      private final long creationTimeInMilliseconds
      The Creation time of the data container in milliseconds.
      Since:
      1.0
    • alertMessage

      private final String alertMessage
      The Alert message to be provided into log or somewhere else, for time points it is ID.
      Since:
      1.0
    • alertListener

      private final TimeGuard.TimeAlertListener alertListener
      Some provided processor to be called for alert.
      Since:
      1.0
  • Constructor Details

    • TimeData

      @Weight(LIGHT) public TimeData(@Constraint("X>1") int stackDepth, String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener)
      The Constructor
      Parameters:
      stackDepth - stack depth
      alertMessage - alert message for time violation
      maxAllowedDelayInMilliseconds - max allowed time gap in milliseconds
      violationListener - listener for the violation alert
      Since:
      1.0
  • Method Details

    • getAlertListener

      public TimeGuard.TimeAlertListener getAlertListener()
      Get alert listener if provided
      Returns:
      the provided alert listener
      Since:
      1.0
    • getAlertMessage

      public String getAlertMessage()
      Get the alert message. For time points it is ID.
      Returns:
      defined alert message.
      Since:
      1.0
    • getDetectedStackDepth

      public int getDetectedStackDepth()
      Get the detected stack depth during the container creation.
      Returns:
      the detected stack depth
      Since:
      1.0
    • getCreationTimeInMilliseconds

      public long getCreationTimeInMilliseconds()
      Get the creation time of the container.
      Returns:
      the creation time in milliseconds
      Since:
      1.0
    • getMaxAllowedDelayInMilliseconds

      public long getMaxAllowedDelayInMilliseconds()
      Get defined max allowed time delay in milliseconds.
      Returns:
      the max allowed time delay in milliseconds
      Since:
      1.0
    • isTimePoint

      public boolean isTimePoint()
      Check that the object represents a named time point.
      Returns:
      true if the object represents a time point created for statistics.