@groovy.util.logging.Slf4j @groovy.transform.CompileStatic @groovy.transform.EqualsAndHashCode(includes = 'durationInMillis') class Duration extends java.lang.Object
A simple time duration representation
| Modifiers | Name | Description |
|---|---|---|
static java.util.List<java.lang.String> |
UNITS |
| Type | Name and description |
|---|---|
long |
durationInMillisDuration in millis |
| Type Params | Return Type | Name and description |
|---|---|---|
|
boolean |
asBoolean() |
|
static Duration |
between(java.time.temporal.Temporal start, java.time.temporal.Temporal end) |
|
int |
compareTo(Duration that) |
|
static int |
compareTo(Duration left, java.lang.Object right) |
|
java.lang.Object |
div(java.lang.Number value) |
|
java.lang.String |
format(java.lang.String fmt)Duration formatting utilities and constants. |
|
long |
getDays() |
|
long |
getHours() |
|
long |
getMillis() |
|
long |
getMinutes() |
|
long |
getSeconds() |
|
java.lang.Object |
minus(Duration value) |
|
java.lang.Object |
multiply(java.lang.Number value) |
|
static Duration |
of(long value) |
|
static Duration |
of(java.lang.String str) |
|
static Duration |
of(java.lang.String str, Duration fallback) |
|
java.lang.Object |
plus(Duration value) |
|
long |
toDays() |
|
long |
toHours() |
|
long |
toMillis() |
|
long |
toMinutes() |
|
long |
toSeconds() |
|
java.lang.String |
toString() |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create e a duration object having the specified number of millis
duration - The duration as millisecondsCreate the object using a string 'duration' format. Accepted prefix are:
ms, milli, millis: for milliseconds
s, second, seconds: for seconds
m, minute, minutes: for minutes
h, hour, hours: for hours
d, day, days: for days
Duration formatting utilities and constants. The following table describes the tokens used in the pattern language for formatting.
character duration element y years d days H hours m minutes s seconds
Groovy Documentation