Package org.jobrunr.scheduling.interval
Class Interval
- java.lang.Object
-
- org.jobrunr.scheduling.Schedule
-
- org.jobrunr.scheduling.interval.Interval
-
-
Field Summary
-
Fields inherited from class org.jobrunr.scheduling.Schedule
SMALLEST_SCHEDULE_IN_SECONDS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Compares this object against the specified object.int
hashCode()
java.time.Instant
next(java.time.Instant createdAtInstant, java.time.Instant currentInstant, java.time.ZoneId zoneId)
Calculates the next occurrence based on the creation time and the provided base time.java.lang.String
toString()
void
validateSchedule()
-
-
-
Method Detail
-
next
public java.time.Instant next(java.time.Instant createdAtInstant, java.time.Instant currentInstant, java.time.ZoneId zoneId)
Description copied from class:Schedule
Calculates the next occurrence based on the creation time and the provided base time.- Specified by:
next
in classSchedule
- Parameters:
createdAtInstant
- Instant object when the schedule was first createdcurrentInstant
- Instant object used to calculate next occurrence (normally Instant.now()).zoneId
- the zone for which to calculate the schedule- Returns:
- Instant of the next occurrence.
-
validateSchedule
public void validateSchedule()
- Specified by:
validateSchedule
in classSchedule
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Compares this object against the specified object. The result istrue
if and only if the argument is notnull
and is aSchedule
object that whose seconds, minutes, hours, days, months, and days of weeks sets are equal to those of this schedule.The expression string used to create the schedule is not considered, as two different expressions may produce same schedules.
-
-