Package io.smallrye.stork.utils
Class DurationUtils
- java.lang.Object
-
- io.smallrye.stork.utils.DurationUtils
-
public class DurationUtils extends Object
A set of utility methods around durations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DurationparseDuration(String duration, String parameter)Converts a value representing the refresh period which start with a number by implicitly appending `PT` to it.
-
-
-
Method Detail
-
parseDuration
public static Duration parseDuration(String duration, String parameter)
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
-
-