Package hudson.util
Class ClockDifference
- java.lang.Object
-
- hudson.util.ClockDifference
-
@ExportedBean public final class ClockDifference extends Object
Represents a clock difference. Immutable.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description long
diff
The difference in milliseconds.static ClockDifference
ZERO
-
Constructor Summary
Constructors Constructor Description ClockDifference(long value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
abs()
Gets the absolute value ofdiff
.boolean
isDangerous()
Returns true if the difference is big enough to be considered dangerous.String
toHtml()
static String
toHtml(Node d)
static String
toHtml(ClockDifference d)
Gets the clock difference in HTML string.String
toString()
Gets the clock difference in HTML string.
-
-
-
Field Detail
-
diff
@Exported public final long diff
The difference in milliseconds. Positive value means the agent is behind the master, negative value means the agent is ahead of the master.
-
ZERO
public static final ClockDifference ZERO
-
-
Method Detail
-
isDangerous
public boolean isDangerous()
Returns true if the difference is big enough to be considered dangerous.
-
abs
public long abs()
Gets the absolute value ofdiff
.
-
toString
public String toString()
Gets the clock difference in HTML string.
-
toHtml
public String toHtml()
-
toHtml
public static String toHtml(ClockDifference d)
Gets the clock difference in HTML string. This version handles nullClockDifference
.
-
-