public abstract static class ScheduleConfig.Schedule
extends java.lang.Object
Constructor and Description |
---|
Schedule() |
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<ScheduleConfig.Schedule> |
create(long interval,
java.lang.String startTime)
Creates a schedule.
|
static ScheduleConfig.Schedule |
createOrFail(long interval,
java.lang.String startTime)
Creates a schedule.
|
abstract long |
initialDelay()
Milliseconds between constructor invocation and first event time.
|
abstract long |
interval()
Number of milliseconds between events.
|
public abstract long interval()
public abstract long initialDelay()
If there is any lag between the constructor invocation and queuing the object into an executor the event will run later, as there is no method to adjust for the scheduling delay.
public static ScheduleConfig.Schedule createOrFail(long interval, java.lang.String startTime)
ScheduleConfig
defines details about which values are valid for the interval
and startTime
parameters.
interval
- the interval in millisecondsstartTime
- the start time as "<day of week> <hours>:<minutes>
" or "<hours>:<minutes>
"java.lang.IllegalArgumentException
- if any of the parameters is invalidpublic static java.util.Optional<ScheduleConfig.Schedule> create(long interval, java.lang.String startTime)
ScheduleConfig
defines details about which values are valid for the interval
and startTime
parameters.
interval
- the interval in millisecondsstartTime
- the start time as "<day of week> <hours>:<minutes>
" or "<hours>:<minutes>
"Optional.empty()
if any of the parameters is invalid