Class TimeGuard.TimeData
java.lang.Object
com.igormaznitsa.meta.common.utils.TimeGuard.TimeData
- All Implemented Interfaces:
Serializable
- Enclosing class:
TimeGuard
Data container for time watching action.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimeData(int stackDepth, String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener) The Constructor -
Method Summary
Modifier and TypeMethodDescriptionGet alert listener if providedGet the alert message.longGet the creation time of the container.intGet the detected stack depth during the container creation.longGet defined max allowed time delay in milliseconds.booleanCheck that the object represents a named time point.
-
Constructor Details
-
TimeData
@Weight(LIGHT) public TimeData(@Constraint("X>1") int stackDepth, String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener) The Constructor- Parameters:
stackDepth- stack depthalertMessage- alert message for time violationmaxAllowedDelayInMilliseconds- max allowed time gap in millisecondsviolationListener- listener for the violation alert- Since:
- 1.0
-
-
Method Details
-
getAlertListener
Get alert listener if provided- Returns:
- the provided alert listener
- Since:
- 1.0
-
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.
-