Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public static Duration of(long amount, TemporalUnit unit) {
   return ZERO.plus(amount, unit);
 }