Class DateAdjusters


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

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

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DateAdjuster nextLeapDay()
      Obtains an instance that finds the next leap day after the input date.
      static DateAdjuster nextOrSameLeapDay()
      Obtains a date adjuster that finds the next leap day on or after the input date.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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