Class DurationUtils

java.lang.Object
io.smallrye.stork.utils.DurationUtils

public class DurationUtils extends Object
A set of utility methods around durations.
  • Method Details

    • 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 String
      parameter - the parameter for which we parse the value to duration
      Returns:
      Duration