Class DateAdjusters


  • public final class DateAdjusters
    extends Object
    Date adjusters that perform useful operations on LocalDate.

    This is a static utility class. Returned objects are immutable and thread-safe.

    • Method Detail

      • nextLeapDay

        public static DateAdjuster nextLeapDay()
        Obtains an instance that finds the next leap day after the input date.

        The adjuster returns the next occurrence of February 29 after the input date.

        Returns:
        an adjuster that finds the next leap day
      • nextOrSameLeapDay

        public static DateAdjuster nextOrSameLeapDay()
        Obtains a date adjuster that finds the next leap day on or after the input date.

        If the input date is February 29, the input date is returned unaltered. Otherwise, the adjuster returns the next occurrence of February 29 after the input date.

        Returns:
        an adjuster that finds the next leap day