public class TimeDuration extends Object
3sec
.
This supports parameter injection, such as via QueryParameter
.Modifier and Type | Class and Description |
---|---|
static class |
TimeDuration.StaplerConverterImpl |
Constructor and Description |
---|
TimeDuration(long millis) |
Modifier and Type | Method and Description |
---|---|
long |
as(TimeUnit t) |
static TimeDuration |
fromString(String delay)
Creates a
TimeDuration from the delay passed in parameter |
int |
getTime()
Deprecated.
use
getTimeInMillis() instead.
This method has always returned a time in milliseconds, when various callers incorrectly assumed seconds.
And this spread through the codebase. So this has been deprecated for clarity in favour of more explicitly named
methods. |
long |
getTimeInMillis()
Returns the duration of this instance in milliseconds.
|
int |
getTimeInSeconds()
Returns the duration of this instance in seconds.
|
@Deprecated public int getTime()
getTimeInMillis()
instead.
This method has always returned a time in milliseconds, when various callers incorrectly assumed seconds.
And this spread through the codebase. So this has been deprecated for clarity in favour of more explicitly named
methods.public long getTimeInMillis()
public int getTimeInSeconds()
public long as(TimeUnit t)
@CheckForNull public static TimeDuration fromString(@CheckForNull String delay)
TimeDuration
from the delay passed in parameterdelay
- the delay either in milliseconds without unit, or in seconds if suffixed by sec or secs.Copyright © 2004–2021. All rights reserved.