Class LocalDateTimeLegacyWrapper

java.lang.Object
org.elasticsearch.xpack.core.scheduler.LocalDateTimeLegacyWrapper

public class LocalDateTimeLegacyWrapper extends Object
This class is designed to wrap the LocalDateTime class in order to make it behave, in terms of mutation, like a legacy Calendar class. This is to provide compatibility with the existing Cron next runtime calculation algorithm which relies on certain quirks of the Calendar such as days of the week being numbered starting on Sunday==1 and being able to set the current hour to 24 and have it roll over to midnight the next day.
  • Constructor Details

    • LocalDateTimeLegacyWrapper

      public LocalDateTimeLegacyWrapper(LocalDateTime ldt)
  • Method Details

    • getYear

      public int getYear()
    • getDayOfMonth

      public int getDayOfMonth()
    • getHour

      public int getHour()
    • getMinute

      public int getMinute()
    • getSecond

      public int getSecond()
    • getDayOfWeek

      public int getDayOfWeek()
    • getMonth

      public int getMonth()
    • setYear

      public void setYear(int year)
    • setDayOfMonth

      public void setDayOfMonth(int dayOfMonth)
    • setMonth

      public void setMonth(int month)
    • setHour

      public void setHour(int hour)
    • setMinute

      public void setMinute(int minute)
    • setSecond

      public void setSecond(int second)
    • plusYears

      public void plusYears(long years)
    • plusSeconds

      public void plusSeconds(long seconds)
    • isAfter

      public boolean isAfter(ChronoLocalDateTime<?> other)
    • isBefore

      public boolean isBefore(ChronoLocalDateTime<?> other)
    • getLocalDateTime

      public LocalDateTime getLocalDateTime()