DurationStyle

Duration format styles.

Author

Phillip Webb

Valentine Wu

Since

2.0.0

Entries

Link copied to clipboard

Simple formatting, for example '1s'.

Link copied to clipboard

ISO-8601 formatting.

Functions

Link copied to clipboard
open fun detect(value: String): DurationStyle
Detect the style from the given source value.
Link copied to clipboard
open fun detectAndParse(value: String): Duration
open fun detectAndParse(value: String, unit: ChronoUnit): Duration
Detect the style then parse the value to return a duration.
Link copied to clipboard
open fun parse(value: String): Duration
abstract fun parse(value: String, unit: ChronoUnit): Duration
Parse the given value to a duration.
Link copied to clipboard
open fun print(value: Duration): String
Print the specified duration.
abstract fun print(value: Duration, unit: ChronoUnit): String
Print the specified duration using the given unit.
Link copied to clipboard
open fun valueOf(name: String): DurationStyle

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.