StroomDuration implements Comparable<StroomDuration>, TemporalAmount { @JsonCreator public static StroomDuration parse(final String value) { return new StroomDuration(value, parseToDuration(value)); } private  StroomDuration(@Nullable final String valueAsStr,
                           final Duration duration); private  StroomDuration(final TemporalAmount temporalAmount); @JsonCreator static StroomDuration parse(final String value); static StroomDuration of(final TemporalAmount temporalAmount); static StroomDuration of(final long amount, final TemporalUnit unit); static StroomDuration ofDays(final long days); static StroomDuration ofHours(final long hours); static StroomDuration ofMinutes(final long minutes); static StroomDuration ofSeconds(final long seconds); static StroomDuration ofMillis(final long millis); static StroomDuration ofNanos(final long nanos); @SuppressWarnings("unused") @JsonValue String getValueAsStr(); @JsonIgnore Duration getDuration(); long toMillis(); long toNanos(); @JsonIgnore boolean isZero(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final StroomDuration o); @Override long get(final TemporalUnit unit); @JsonIgnore @Override List<TemporalUnit> getUnits(); @Override Temporal addTo(final Temporal temporal); @Override Temporal subtractFrom(final Temporal temporal); static final StroomDuration ZERO; }
@Test void testParse() { System.out.println(Duration.ZERO.toString()); doParseTest("30d", "P30D", Duration.ofDays(30)); doParseTest("12h", "PT12H", Duration.ofHours(12)); doParseTest("5m", "PT5M", Duration.ofMinutes(5)); doParseTest("10s", "PT10S", Duration.ofSeconds(10)); doParseTest("100ms", "PT0.1S", Duration.ofMillis(100)); doParseTest("100", "PT0.1S", Duration.ofMillis(100)); }