| Modifier and Type | Field and Description |
|---|---|
| public static final String | DATE_FORMAT
The format used for parsing and formatting dates. |
| private static final DateTimeFormatter | |
| private volatile boolean | |
| private static final long | INTERNAL_MAX_VALUE
A special internal value that marks a deadline as the longest possible. |
| private static final long | INTERNAL_MIN_VALUE
A special internal value that marks a deadline as the shortest possible. |
| private volatile long | |
| public static Deadline | MAX_VALUE
The maximum (longest-lived) deadline. |
| public static Deadline | MIN_VALUE
The minimum (shortest-lived) deadline. |
| private final long |
| Access | Constructor and Description |
|---|---|
| private | Deadline(final long
UNIX time in milliseconds. deadlineMillis)Constructs a new instance with the given UNIX time in milliseconds. |
| Modifier and Type | Method and Description |
|---|---|
| public static Deadline | Returns: a deadline representing the current time plus the given time value.A time in UNIX milliseconds, usually the current time. timeMillis, final TimeValue time value to add to timeValue)timeMillis.Calculates a deadline with a given time in milliseconds plus a given time value. |
| public static Deadline | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public String | |
| public String | Returns: a formatted string in the format yyyy-MM-dd\'T\'HH:mm:ss.SSSZ.Formats the deadline value as a string in the format yyyy-MM-dd\'T\'HH:mm:ss.SSSZ. |
| public Deadline | |
| public static Deadline | Returns: a new deadline.a UNIX time in milliseconds. value)Creates a deadline from a UNIX time in milliseconds. |
| pack-priv long | |
| public long | |
| public int | |
| public boolean | Returns: whether this deadline occurs before the given time in milliseconds.the time to compare. millis)Returns whether this deadline occurs before the given time in milliseconds. |
| public boolean | |
| public boolean | Returns: whether this deadline is the maximum deadline.Returns whether this deadline is the maximum deadline. |
| public boolean | Returns: whether this deadline is the minimum deadline.Returns whether this deadline is the minimum deadline. |
| public boolean | Returns: whether this deadline has not expired.Returns whether this deadline has not expired. |
| public Deadline | |
| public static Deadline | |
| public long | Returns: the different in milliseconds between the deadline and now.Returns the difference in milliseconds between the deadline and now. |
| public TimeValue | Returns: Returns the different as a TimeValue between the deadline and now.Returns the difference as a TimeValue between the deadline and now. |
| private void | |
| public String |
| DATE_FORMAT | back to summary |
|---|---|
| public static final String DATE_FORMAT The format used for parsing and formatting dates. | |
| DATE_TIME_FORMATTER | back to summary |
|---|---|
| private static final DateTimeFormatter DATE_TIME_FORMATTER | |
| frozen | back to summary |
|---|---|
| private volatile boolean frozen | |
| INTERNAL_MAX_VALUE | back to summary |
|---|---|
| private static final long INTERNAL_MAX_VALUE A special internal value that marks a deadline as the longest possible. | |
| INTERNAL_MIN_VALUE | back to summary |
|---|---|
| private static final long INTERNAL_MIN_VALUE A special internal value that marks a deadline as the shortest possible. | |
| lastCheck | back to summary |
|---|---|
| private volatile long lastCheck | |
| MAX_VALUE | back to summary |
|---|---|
| public static Deadline MAX_VALUE The maximum (longest-lived) deadline. | |
| MIN_VALUE | back to summary |
|---|---|
| public static Deadline MIN_VALUE The minimum (shortest-lived) deadline. | |
| value | back to summary |
|---|---|
| private final long value | |
| Deadline | back to summary |
|---|---|
| private Deadline(final long deadlineMillis) Constructs a new instance with the given UNIX time in milliseconds.
| |
| calculate | back to summary |
|---|---|
| public static Deadline calculate(final long timeMillis, final TimeValue timeValue) Calculates a deadline with a given time in milliseconds plus a given time value. Non-positive time values represent an indefinite timeout without a deadline. | |
| calculate | back to summary |
|---|---|
| public static Deadline calculate(final TimeValue timeValue) Calculates a deadline from now plus a given time value. Non-positive time values represent an indefinite timeout without a deadline. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| format | back to summary |
|---|---|
| public String format(final TimeUnit overdueTimeUnit) Formats this deadline. | |
| formatTarget | back to summary |
|---|---|
| public String formatTarget() Formats the deadline value as a string in the format yyyy-MM-dd\'T\'HH:mm:ss.SSSZ.
| |
| freeze | back to summary |
|---|---|
| public Deadline freeze() | |
| fromUnixMilliseconds | back to summary |
|---|---|
| public static Deadline fromUnixMilliseconds(final long value) Creates a deadline from a UNIX time in milliseconds.
| |
| getLastCheck | back to summary |
|---|---|
| pack-priv long getLastCheck() Package private for testing.
| |
| getValue | back to summary |
|---|---|
| public long getValue() Gets the UNIX time deadline value.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isBefore | back to summary |
|---|---|
| public boolean isBefore(final long millis) Returns whether this deadline occurs before the given time in milliseconds.
| |
| isExpired | back to summary |
|---|---|
| public boolean isExpired() Returns whether the deadline has expired.
| |
| isMax | back to summary |
|---|---|
| public boolean isMax() Returns whether this deadline is the maximum deadline.
| |
| isMin | back to summary |
|---|---|
| public boolean isMin() Returns whether this deadline is the minimum deadline.
| |
| isNotExpired | back to summary |
|---|---|
| public boolean isNotExpired() Returns whether this deadline has not expired.
| |
| min | back to summary |
|---|---|
| public Deadline min(final Deadline other) Returns the smaller of this and another | |
| parse | back to summary |
|---|---|
| public static Deadline parse(final String source) throws ParseException Creates a deadline from a string in the format yyyy-MM-dd\'T\'HH:mm:ss.SSSZ.
| |
| remaining | back to summary |
|---|---|
| public long remaining() Returns the difference in milliseconds between the deadline and now.
| |
| remainingTimeValue | back to summary |
|---|---|
| public TimeValue remainingTimeValue() Returns the difference as a TimeValue between the deadline and now.
| |
| setLastCheck | back to summary |
|---|---|
| private void setLastCheck() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |