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)
Formats
duration as a string. |
protected String |
formatUnitPlural(ChronoUnit unit) |
protected String |
formatUnitSingular(ChronoUnit unit) |
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)
duration as a string.duration - the durationprotected String formatUnitPlural(ChronoUnit unit)
protected String formatUnitSingular(ChronoUnit unit)
Copyright © 2020. All rights reserved.