Enum Class DurationFormat.Style
- All Implemented Interfaces:
- Serializable,- Comparable<DurationFormat.Style>,- Constable
- Enclosing class:
- DurationFormat
Duration format styles.- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum Constants
- 
Method SummaryModifier and TypeMethodDescriptionstatic DurationFormat.StyleReturns the enum constant of this class with the specified name.static DurationFormat.Style[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
SIMPLESimple formatting based on a short suffix, for example '1s'.Supported unit suffixes include: ns, us, ms, s, m, h, d. Those correspond to nanoseconds, microseconds, milliseconds, seconds, minutes, hours, and days, respectively.Note that when printing a Duration, this style can be lossy if the selected unit is bigger than the resolution of the duration. For example,Duration.ofMillis(5).plusNanos(1234)would get truncated to"5ms"when printing usingChronoUnit.MILLIS.Fractional durations are not supported. 
- 
ISO8601ISO-8601 formatting.This is what the JDK uses in Duration.parse(CharSequence)andDuration.toString().
- 
COMPOSITELikeSIMPLE, but allows multiple segments ordered from largest-to-smallest units of time, like1h12m27s.A single minus sign ( -) is allowed to indicate the whole duration is negative. Spaces are allowed between segments, and a negative duration with spaced segments can optionally be surrounded by parentheses after the minus sign, like so:-(34m 57s).
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
 
-