Package org.hippoecm.frontend.util
Class DurationUtils
- java.lang.Object
-
- org.hippoecm.frontend.util.DurationUtils
-
public class DurationUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Duration
parse(String durationAsString)
Since Wicket 9, a Duration can no longer be constructed by the custom format specified inDuration
, e.g.
-
-
-
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'sjava.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
-
-