public class DurationUtils
extends java.lang.Object
Constructor and Description |
---|
DurationUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
parse(java.lang.String durationString)
Parses a human readable duration string and calculates the number of seconds it represents.
|
static java.lang.String |
toString(int durationSeconds)
Create a human readable duration string from seconds.
|
static java.lang.String |
toString(int durationSeconds,
boolean includeMonths)
Create a human readable duration string from seconds.
|
public static final java.lang.String toString(int durationSeconds)
durationSeconds
- the total number of seconds in the durationpublic static final java.lang.String toString(int durationSeconds, boolean includeMonths)
durationSeconds
- the total number of seconds in the durationincludeMonths
- when true will include months "mo", in the string otherwise
uses "4w" for each monthpublic static final int parse(java.lang.String durationString)
durationString
- the human readable duration