Class SingleExecutionTime
java.lang.Object
io.github.projectunified.cronutils.model.time.SingleExecutionTime
- All Implemented Interfaces:
ExecutionTime
Calculates execution time given a cron pattern.
-
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
-
Method Details
-
nextExecution
Provide 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
Provide nearest time for next execution.- 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
Provide nearest date for last execution.- 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
Provide 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
Provide 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.
-