Package io.quarkus.runtime.configuration
Class DurationConverter
- java.lang.Object
-
- io.quarkus.runtime.configuration.DurationConverter
-
- All Implemented Interfaces:
Serializable,org.eclipse.microprofile.config.spi.Converter<Duration>
@Priority(200) public class DurationConverter extends Object implements org.eclipse.microprofile.config.spi.Converter<Duration>, Serializable
A converter for aDurationinterface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DurationConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Durationconvert(String value)The converter accepts a value which start with a number by implicitly appending `PT` to it or `P` for days.static DurationparseDuration(String value)Converts a value which start with a number by implicitly appending `PT` to it or `P` for days.
-
-
-
Method Detail
-
convert
public Duration convert(String value)
The converter accepts a value which start with a number by implicitly appending `PT` to it or `P` for days. If the value consists only of a number, it implicitly treats the value as seconds. Otherwise, tries to convert the value assuming that it is in the accepted ISO-8601 duration format.
-
parseDuration
public static Duration parseDuration(String value)
Converts a value which start with a number by implicitly appending `PT` to it or `P` for days. If the value consists only of a number, it implicitly treats the value as seconds. Otherwise, tries to convert the value assuming that it is in the accepted ISO-8601 duration format.- Parameters:
value- duration as String- Returns:
Duration
-
-