public class Duration extends Object
The recognized units of time are the "millisecond", "second", "minute" "hour" and "day". The unit name may be followed by an "s". Thus, "2 day" and "2 days" are equivalent. In the absence of a time unit specification, milliseconds are assumed.
Note: the conversion magic is entirely due to the fact that this class follows the valueOf(java.lang.String) convention.
| Constructor and Description |
|---|
Duration(long millis)
|
| Modifier and Type | Method and Description |
|---|---|
static Duration |
buildByDays(double value)
|
static Duration |
buildByHours(double value)
|
static Duration |
buildByMilliseconds(double value)
|
static Duration |
buildByMinutes(double value)
|
static Duration |
buildBySeconds(double value)
|
static Duration |
buildUnbounded()
|
long |
getMilliseconds()
|
String |
toString()
|
static Duration |
valueOf(String
|
public static DurationbuildByMilliseconds(double value)
public static DurationbuildBySeconds(double value)
public static DurationbuildByMinutes(double value)
public static DurationbuildByHours(double value)
public static DurationbuildByDays(double value)
public static DurationbuildUnbounded()
public long getMilliseconds()
public StringtoString()