Interface DateAdjuster

All Known Implementing Classes:
DateAdjusters.DayOfWeekInMonth, DateAdjusters.Impl, DateAdjusters.RelativeDayOfWeek, LocalDate, LocalDateTime, MonthDay, OffsetDate, OffsetDateTime, Year, YearMonth

public interface DateAdjuster
Strategy for adjusting a date.

This interface provides a common way to access many different date adjustments. Examples might be an adjuster that sets the date avoiding weekends, or one that sets the date to the last day of the month.

DateAdjuster is an interface and must be implemented with care to ensure other classes in the framework operate correctly. All instantiable implementations must be final, immutable and thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    Adjusts the input date returning the adjusted date.
  • Method Details

    • adjustDate

      LocalDate adjustDate(LocalDate date)
      Adjusts the input date returning the adjusted date.

      This is a strategy pattern that allows a range of adjustments to be made to a date.

      Parameters:
      date - the date to adjust, not null
      Returns:
      the adjusted date, never null