public class Duration extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
boolean |
finite |
static Duration |
INFINITE
A duration of Long.MAX_VALUE Days
|
long |
length |
TimeUnit |
timeUnit |
Modifier and Type | Method and Description |
---|---|
static Duration |
days(long count)
Returns a Duration of
count days. |
boolean |
equals(Object obj) |
int |
hashCode() |
static Duration |
hours(long count)
Returns a Duration of
count hours. |
static Duration |
inf()
Returns an infinite duration of Long.MAX_VALUE days.
|
static Duration |
infinite()
Returns an infinite duration of Long.MAX_VALUE days.
|
static Duration |
microseconds(long count)
Returns a Duration of
count microseconds. |
static Duration |
millis(long count)
Returns a Duration of
count milliseconds. |
static Duration |
milliseconds(long count)
Returns a Duration of
count milliseconds. |
static Duration |
mins(long count)
Returns a Duration of
count minutes. |
static Duration |
minutes(long count)
Returns a Duration of
count minutes. |
static Duration |
nanos(long count)
Returns a Duration of
count nanoseconds. |
static Duration |
nanoseconds(long count)
Returns a Duration of
count nanoseconds. |
static Duration |
of(long count,
TimeUnit unit)
Returns a Duration of
count unit s. |
static Duration |
of(String duration)
Returns a Duration from the parsed
duration . |
static Duration |
seconds(long count)
Returns a Duration of
count seconds. |
static Duration |
secs(long count)
Returns a Duration of
count seconds. |
long |
toDays()
Returns the Duration converted to days.
|
long |
toHours()
Returns the Duration converted to hours.
|
long |
toMicros()
Returns the Duration converted to microseconds.
|
long |
toMicroseconds()
Returns the Duration converted to microseconds.
|
long |
toMillis()
Returns the Duration converted to milliseconds.
|
long |
toMilliseconds()
Returns the Duration converted to milliseconds.
|
long |
toMins()
Returns the Duration converted to minutes.
|
long |
toMinutes()
Returns the Duration converted to minutes.
|
long |
toNanos()
Returns the Duration converted to nanoseconds.
|
long |
toNanoseconds()
Returns the Duration converted to nanoseconds.
|
long |
toSeconds()
Returns the Duration converted to seconds.
|
long |
toSecs()
Returns the Duration converted to seconds.
|
String |
toString() |
public static final Duration INFINITE
public final long length
public final TimeUnit timeUnit
public final boolean finite
public long toDays()
public long toHours()
public long toMicros()
public long toMicroseconds()
public long toMillis()
public long toMilliseconds()
public long toMins()
public long toMinutes()
public long toNanos()
public long toNanoseconds()
public long toSeconds()
public long toSecs()
public static Duration days(long count)
count
days.public static Duration hours(long count)
count
hours.public static Duration inf()
public static Duration infinite()
public static Duration microseconds(long count)
count
microseconds.public static Duration millis(long count)
count
milliseconds.public static Duration milliseconds(long count)
count
milliseconds.public static Duration mins(long count)
count
minutes.public static Duration minutes(long count)
count
minutes.public static Duration nanos(long count)
count
nanoseconds.public static Duration nanoseconds(long count)
count
nanoseconds.public static Duration of(String duration)
duration
. Example:
5 s 5 seconds 10m 10 minutes
public static Duration seconds(long count)
count
seconds.public static Duration secs(long count)
count
seconds.Copyright © 2016. All rights reserved.