Class CompositeExecutionTime
java.lang.Object
io.github.projectunified.cronutils.model.time.CompositeExecutionTime
- All Implemented Interfaces:
ExecutionTime
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisMatch(ZonedDateTime date) Provide feedback if a given date matches the cron expression.lastExecution(ZonedDateTime date) Provide nearest date for last execution.nextExecution(ZonedDateTime date) Provide nearest date for next execution.Provide nearest time from last execution.Provide nearest time for next execution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.cronutils.model.time.ExecutionTime
countExecutions, getExecutionDates
-
Constructor Details
-
CompositeExecutionTime
-
-
Method Details
-
nextExecution
Description copied from interface:ExecutionTimeProvide nearest date for next execution.- Specified by:
nextExecutionin interfaceExecutionTime- Parameters:
date- - ZonedDateTime instance. If null, a NullPointerException will be raised.- Returns:
- Optional ZonedDateTime instance, never null. Contains next execution time or empty.
-
timeToNextExecution
Description copied from interface:ExecutionTimeProvide nearest time for next execution. Due to the question #468 we clarify: crons execute on local instance time. See: https://serverfault.com/questions/791713/what-time-zone-is-a-cron-job-using We ask for a ZonedDateTime for two reasons: (i) to provide flexibility on which timezone the cron is being executed (ii) to be able to reproduce issues regardless of our own local time (e.g.: daylight savings, etc.)- Specified by:
timeToNextExecutionin interfaceExecutionTime- Parameters:
date- - ZonedDateTime instance. If null, a NullPointerException will be raised.- Returns:
- Duration instance, never null. Time to next execution.
-
lastExecution
Description copied from interface:ExecutionTimeProvide nearest date for last execution. Due to the question #468 we clarify: crons execute on local instance time. See: https://serverfault.com/questions/791713/what-time-zone-is-a-cron-job-using We ask for a ZonedDateTime for two reasons: (i) to provide flexibility on which timezone the cron is being executed (ii) to be able to reproduce issues regardless of our own local time (e.g.: daylight savings, etc.)- Specified by:
lastExecutionin interfaceExecutionTime- Parameters:
date- - ZonedDateTime instance. If null, a NullPointerException will be raised.- Returns:
- Optional ZonedDateTime instance, never null. Last execution time or empty.
-
timeFromLastExecution
Description copied from interface:ExecutionTimeProvide nearest time from last execution.- Specified by:
timeFromLastExecutionin interfaceExecutionTime- Parameters:
date- - ZonedDateTime instance. If null, a NullPointerException will be raised.- Returns:
- Duration instance, never null. Time from last execution.
-
isMatch
Description copied from interface:ExecutionTimeProvide feedback if a given date matches the cron expression.- Specified by:
isMatchin interfaceExecutionTime- Parameters:
date- - ZonedDateTime instance. If null, a NullPointerException will be raised.- Returns:
- true if date matches cron expression requirements, false otherwise.
-