Class DurationParser

java.lang.Object
io.github.pimak.ntfy.core.DurationParser

public final class DurationParser extends Object
Parses the several duration spellings the ntfy configuration surface accepts into a Duration. Framework-neutral replacement for the old Logback Duration coercion:
  • a bare integer is interpreted as milliseconds ("500" => 500ms);
  • a suffixed integer uses the unit suffix: ms, s, m, h, d ("5s", "3m", "2h", "1d");
  • an ISO-8601 duration is parsed by Duration.parse(java.lang.CharSequence) ("PT5S").

An unparseable value throws IllegalArgumentException.