Temporal.plus

Returns an object of the same type as this object with an amount added. !(p) This adjusts this temporal, adding according to the rules of the specified amount. The amount is typically a {@link hunt.time.Period} but may be any other type implementing the {@link TemporalAmount} interface, such as {@link hunt.time.Duration}. !(p) Some example code indicating how and why this method is used: !(pre) date = date.plus(period); // add a Period instance date = date.plus(duration); // add a Duration instance date = date.plus(workingDays(6)); // example user-written workingDays method </pre> !(p) Note that calling {@code plus} followed by {@code minus} is not guaranteed to return the same date-time.

@implSpec !(p) Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations. !(p) The implementation must behave equivalent to this code: !(pre) return amount.addTo(this); </pre>

@param amount the amount to add, not null @return an object of the same type with the specified adjustment made, not null @throws DateTimeException if the addition cannot be made @throws ArithmeticException if numeric overflow occurs

  1. Temporal plus(TemporalAmount amount)
    interface Temporal
  2. Temporal plus(long amountToAdd, TemporalUnit unit)

Meta