Interface DateAdjuster

  • All Superinterfaces:
    TemporalAdjuster
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface DateAdjuster
    extends TemporalAdjuster
    Functional interface that can adjust a date.

    This extends TemporalAdjuster for those cases where the temporal to be adjusted is an ISO-8601 date.

    • Method Detail

      • adjust

        LocalDate adjust​(LocalDate date)
        Adjusts the date according to the rules of the implementation.

        Implementations must specify how the date is adjusted.

        Parameters:
        date - the date to adjust
        Returns:
        the adjusted date
        Throws:
        DateTimeException - if unable to make the adjustment
        ArithmeticException - if numeric overflow occurs
      • adjustInto

        default Temporal adjustInto​(Temporal temporal)
        Adjusts the temporal according to the rules of the implementation.

        This method implements TemporalAdjuster by calling adjust(LocalDate). Note that conversion to LocalDate ignores the calendar system of the input, which is the desired behaviour in this case.

        Specified by:
        adjustInto in interface TemporalAdjuster
        Parameters:
        temporal - the temporal to adjust
        Returns:
        the adjusted temporal
        Throws:
        DateTimeException - if unable to make the adjustment
        ArithmeticException - if numeric overflow occurs