public static Duration from(TemporalAmount amount) { Objects.requireNonNull(amount, "amount"); Duration duration = ZERO; for (TemporalUnit unit : amount.getUnits()) { duration = duration.plus(amount.get(unit), unit); } return duration; }
public static Duration of(long amount, TemporalUnit unit) { return ZERO.plus(amount, unit); }