Package dev.demeng.pluginbase
Enum Class Time.DurationFormatter
- All Implemented Interfaces:
Serializable,Comparable<Time.DurationFormatter>,Constable
- Enclosing class:
- Time
The duration formatters.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe concise format: 3w 2d 1h.The concise, but low accuracy (maximum 3 time units) format.The long format: 3 weeks 2 days 1 hour. -
Method Summary
Modifier and TypeMethodDescriptionConvenience method for accessingformat(Duration, boolean, int)through existing enumeration implementations.static StringFormatsdurationas a string, either in aconcise(1 letter) or full length format, displaying all possible elements.static StringFormatsdurationas a string, either in aconcise(1 letter) or full length format, displaying up to the specified number ofelements.static Time.DurationFormatterReturns the enum constant of this class with the specified name.static Time.DurationFormatter[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LONG
The long format: 3 weeks 2 days 1 hour. -
CONCISE
The concise format: 3w 2d 1h. -
CONCISE_LOW_ACCURACY
The concise, but low accuracy (maximum 3 time units) format.
-
-
Method Details
-
values
Returns 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
-
valueOf
Returns 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 nameNullPointerException- if the argument is null
-
format
Convenience method for accessingformat(Duration, boolean, int)through existing enumeration implementations.- Parameters:
duration- the duration- Returns:
- the formatted string
-
format
Formatsdurationas a string, either in aconcise(1 letter) or full length format, displaying up to the specified number ofelements.- Parameters:
duration- The durationconcise- If the output should be concisely formattedelements- The maximum number of elements to display- Returns:
- the formatted string
-
format
Formatsdurationas a string, either in aconcise(1 letter) or full length format, displaying all possible elements.- Parameters:
duration- The durationconcise- If the output should be concisely formatted- Returns:
- The formatted string
-