public static interface DateTime.WithAdjuster
This interface allows different kinds of adjustment to be modeled. Examples might be an adjuster that sets the date avoiding weekends, or one that sets the date to the last day of the month.
Implementations should not normally be used directly.
Instead, the DateTime.with(WithAdjuster)
method should be used:
dateTime = dateTime.with(adjuster);
See DateTimeAdjusters
for a standard set of adjusters, including finding the
last day of the month.
Modifier and Type | Method and Description |
---|---|
DateTime |
doAdjustment(DateTime dateTime)
Implementation of the strategy to make an adjustment to the specified date-time object.
|
DateTime doAdjustment(DateTime dateTime)
This method is not intended to be called by application code directly.
Instead, the DateTime.with(WithAdjuster)
method should be used:
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. Implementations may choose to document compatibility with other calendar systems, or validate for it by querying the calendar system from the input object.
dateTime
- the date-time object to adjust, not nullDateTimeException
- if unable to make the adjustmentArithmeticException
- if numeric overflow occurs