Class ScheduleInterval

    • Constructor Detail

      • ScheduleInterval

        public ScheduleInterval()
    • Method Detail

      • getValue

        public int getValue()
        Get the interval duration.
        Returns:
        The interval duration.
      • setValue

        public ScheduleInterval setValue​(int value)
        Set the interval duration.
        Parameters:
        value - The interval duration.
        Returns:
        fluent API
      • getUnit

        public IntervalUnit getUnit()
        Get the interval time unit.
        Returns:
        The interval time unit.
      • setUnit

        public ScheduleInterval setUnit​(IntervalUnit unit)
        Set the interval time unit.
        Parameters:
        unit - The interval time unit.
        Returns:
        fluent API
      • isValid

        public boolean isValid()
        Whether this interval definition is valid.

        A valid interval has a value greater than zero, and has a non-null unit set.

        Returns:
        Whether this interval definition is valid.
      • isDue

        public boolean isDue​(int startTimestamp,
                             int lastTimestamp,
                             int timestamp,
                             java.time.ZoneId zone)
        Check if this interval is due for execution.
        Parameters:
        startTimestamp - start timestamp of the schedule
        lastTimestamp - The timestamp of the last execution.
        timestamp - The current timestamp.
        zone - time-zone
        Returns:
        Whether the associated schedule should is due for execution based on this interval.