public static interface DateTime.PlusAdjuster
This interface allows different types of addition to be modeled. Implementations of this interface are used to add to a date-time.
Implementations should not normally be used directly.
Instead, the DateTime.plus(PlusAdjuster)
method should be used:
dateTime = dateTime.plus(adjuster);
DateTime doAdd(DateTime dateTime)
This method is not intended to be called by application code directly.
Instead, the DateTime.plus(PlusAdjuster)
method should be used:
Duration
will add the length of the duration.
Implementations must use the methods on DateTime
to make the adjustment.
The returned object must have the same observable type as this object.
The input object will be mutated if it is mutable, or a new object returned if immutable.
This interface can be used by calendar systems other than ISO.
Typically this requires no extra work, because the algorithm for adding/subtraing in
the calendar system is part of the DateTime
implementation.
dateTime
- the date-time object to adjust, not nullDateTimeException
- if unable to addArithmeticException
- if numeric overflow occurs