Class TimeGuard.TimeData
- java.lang.Object
-
- com.igormaznitsa.meta.common.utils.TimeGuard.TimeData
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- TimeGuard
public static final class TimeGuard.TimeData extends java.lang.Object implements java.io.Serializable
Data container for time watching action.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private TimeGuard.TimeAlertListener
alertListener
Some provided processor to be called for alert.private java.lang.String
alertMessage
The Alert message to be provided into log or somewhere else, for time points it is ID.private long
creationTimeInMilliseconds
The Creation time of the data container in milliseconds.private long
maxAllowedDelayInMilliseconds
Max allowed time delay in milliseconds.private static long
serialVersionUID
private int
stackDepth
Contains detected stack depth for creation.
-
Constructor Summary
Constructors Constructor Description TimeData(int stackDepth, java.lang.String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener)
The Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeGuard.TimeAlertListener
getAlertListener()
Get alert listener if providedjava.lang.String
getAlertMessage()
Get the alert message.long
getCreationTimeInMilliseconds()
Get the creation time of the container.int
getDetectedStackDepth()
Get the detected stack depth during the container creation.long
getMaxAllowedDelayInMilliseconds()
Get defined max allowed time delay in milliseconds.boolean
isTimePoint()
Check that the object represents a named time point.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 java.lang.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 Detail
-
TimeData
@Weight(LIGHT) public TimeData(@Constraint("X>1") int stackDepth, java.lang.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 Detail
-
getAlertListener
public TimeGuard.TimeAlertListener getAlertListener()
Get alert listener if provided- Returns:
- the provided alert listener
- Since:
- 1.0
-
getAlertMessage
public java.lang.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.
-
-