public enum DurationFormatter extends Enum<DurationFormatter>
| Enum Constant and Description |
|---|
CONCISE |
CONCISE_LOW_ACCURACY |
LONG |
| Modifier and Type | Method and Description |
|---|---|
String |
format(Duration duration)
Convenience method for accessing
format(Duration, boolean, int)
through existing enumeration implementations. |
static String |
format(Duration duration,
boolean concise)
Formats
duration as a string, either in a concise (1 letter)
or full length format, displaying all possible elements. |
static String |
format(Duration duration,
boolean concise,
int elements)
Formats
duration as a string, either in a concise (1 letter)
or full length format, displaying up to the specified number of elements. |
static DurationFormatter |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DurationFormatter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DurationFormatter LONG
public static final DurationFormatter CONCISE
public static final DurationFormatter CONCISE_LOW_ACCURACY
public static DurationFormatter[] values()
for (DurationFormatter c : DurationFormatter.values()) System.out.println(c);
public static DurationFormatter valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String format(Duration duration)
format(Duration, boolean, int)
through existing enumeration implementations.duration - the durationpublic static String format(Duration duration, boolean concise, int elements)
duration as a string, either in a concise (1 letter)
or full length format, displaying up to the specified number of elements.duration - the durationconcise - if the output should be concisely formattedelements - the maximum number of elements to displaypublic static String format(Duration duration, boolean concise)
duration as a string, either in a concise (1 letter)
or full length format, displaying all possible elements.duration - the durationconcise - if the output should be concisely formattedCopyright © 2022. All rights reserved.