Package io.smallrye.stork.utils
Class DurationUtils
java.lang.Object
io.smallrye.stork.utils.DurationUtils
A set of utility methods around durations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DurationparseDuration(String duration, String parameter) Converts a value representing the refresh period which start with a number by implicitly appending `PT` to it.
-
Method Details
-
parseDuration
Converts a value representing the refresh period which start with a number by implicitly appending `PT` to it. 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:
duration- duration as Stringparameter- the parameter for which we parse the value to duration- Returns:
Duration
-