Class DurationUtils


  • public class DurationUtils
    extends Object
    • Method Detail

      • parse

        public static Duration parse​(String durationAsString)

        Since Wicket 9, a Duration can no longer be constructed by the custom format specified in Duration, e.g. "8 hours" or "5 seconds". Instead, Wicket now uses the JDK's java.time package and durations are parsed using the ISO-8601 duration format PnDTnHnMn.nS with days considered to be exactly 24 hours.

        For backwards compatibility, we first try the new format and fallback to the deprecated format in case of an error.

        Parameters:
        durationAsString - The duration formatted as a string.
        Returns:
        A new Duration based on the input string