public final class TimeoutDuration
extends java.lang.Object
java.util.concurrent.TimeUnit
class.Modifier and Type | Field and Description |
---|---|
static TimeoutDuration |
NONE
Constant indicating no timeout.
|
Modifier and Type | Method and Description |
---|---|
long |
convert(java.util.concurrent.TimeUnit toUnit)
Converts this
TimeDuration to the specified time unit. |
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
static TimeoutDuration |
of(long amount,
java.util.concurrent.TimeUnit unit)
Gets a
TimeoutDuration of the indicated duration. |
void |
timedWait(java.lang.Object obj)
Performs a timed wait on the object provided.
|
long |
toMillis()
Converts this
TimeoutDuration to milliseconds. |
long |
toNanos()
Converts this
TimeoutDuration to nanoseconds. |
java.lang.String |
toString() |
public static final TimeoutDuration NONE
public static TimeoutDuration of(long amount, java.util.concurrent.TimeUnit unit)
TimeoutDuration
of the indicated duration.amount
- the non-negative timeout durationunit
- the non-null
units for amount
TimeoutDuration
instance for the specified durationjava.lang.NullPointerException
- if unit
is null
java.lang.IllegalArgumentException
- if amount
is negativepublic long toNanos()
TimeoutDuration
to nanoseconds. Values are converted
according to the rules for java.util.concurrent.TimeUnit
.TimeDuration
public long toMillis()
TimeoutDuration
to milliseconds. Values are converted
according to the rules for java.util.concurrent.TimeUnit
.TimeDuration
public long convert(java.util.concurrent.TimeUnit toUnit)
TimeDuration
to the specified time unit. Values are
converted according to the rules for java.util.concurrent.TimeUnit
.toUnit
- the TimeUnit
to which this TimeDuration
value is convertedtoUnit
unitsTimeUnit.convert(long, TimeUnit)
public void timedWait(java.lang.Object obj) throws java.lang.InterruptedException
obj
- the Object
on which to waitjava.lang.InterruptedException
- if the wait is interruptedTimeUnit.timedWait(Object, long)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object