Duration.plus

Returns a copy of this duration with the specified duration added. !(p) The duration amount is measured _in terms of the specified unit. Only a subset of units are accepted by this method. The unit must either have an {@linkplain TemporalUnit#isDurationEstimated() exact duration} or be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception. !(p) This instance is immutable and unaffected by this method call.

@param amountToAdd the amount to add, measured _in terms of the unit, positive or negative @param unit the unit that the amount is measured _in, must have an exact duration, not null @return a {@code Duration} based on this duration with the specified duration added, not null @throws UnsupportedTemporalTypeException if the unit is not supported @throws ArithmeticException if numeric overflow occurs

  1. Duration plus(Duration duration)
  2. Duration plus(long amountToAdd, TemporalUnit unit)
    class Duration

Meta