Class ScheduleInterval
java.lang.Object
com.gentics.contentnode.rest.model.scheduler.ScheduleInterval
Interval definition for
ScheduleData
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getUnit()
Get the interval time unit.int
getValue()
Get the interval duration.boolean
isDue
(int startTimestamp, int lastTimestamp, int timestamp, java.time.ZoneId zone) Check if this interval is due for execution.boolean
isValid()
Whether this interval definition is valid.setUnit
(IntervalUnit unit) Set the interval time unit.setValue
(int value) Set the interval duration.toString()
-
Constructor Details
-
ScheduleInterval
public ScheduleInterval()
-
-
Method Details
-
getValue
public int getValue()Get the interval duration.- Returns:
- The interval duration.
-
setValue
Set the interval duration.- Parameters:
value
- The interval duration.- Returns:
- fluent API
-
getUnit
Get the interval time unit.- Returns:
- The interval time unit.
-
setUnit
Set the interval time unit.- Parameters:
unit
- The interval time unit.- Returns:
- fluent API
-
isValid
public boolean isValid()Whether this interval definition is valid.A valid interval has a
value
greater than zero, and has a non-nullunit
set.- Returns:
- Whether this interval definition is valid.
-
isDue
public boolean isDue(int startTimestamp, int lastTimestamp, int timestamp, java.time.ZoneId zone) Check if this interval is due for execution.- Parameters:
startTimestamp
- start timestamp of the schedulelastTimestamp
- The timestamp of the last execution.timestamp
- The current timestamp.zone
- time-zone- Returns:
- Whether the associated schedule should is due for execution based on this interval.
-
equals
-
toString
-