Class IntervalSchedule
java.lang.Object
org.sterl.spring.persistent_tasks.api.IntervalSchedule
- All Implemented Interfaces:
Serializable,Schedule
A schedule based on a fixed time interval.
Examples:
- Duration.ofHours(1) - Every hour
- Duration.ofMinutes(30) - Every 30 minutes
- Duration.ofDays(1) - Every day
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a human-readable description of this schedule.booleaninthashCode()next(OffsetDateTime from) Calculates the next execution time from the given time.toString()
-
Constructor Details
-
IntervalSchedule
Creates a new interval schedule.- Parameters:
interval- the time interval between executions- Throws:
IllegalArgumentException- if interval is null, zero, or negative
-
-
Method Details
-
next
Description copied from interface:ScheduleCalculates the next execution time from the given time. -
description
Description copied from interface:ScheduleReturns a human-readable description of this schedule.- Specified by:
descriptionin interfaceSchedule- Returns:
- description of the schedule
-
toString
-
getInterval
-
equals
-
hashCode
public int hashCode()
-