Class ScheduleInterval
- java.lang.Object
-
- com.gentics.contentnode.rest.model.scheduler.ScheduleInterval
-
public class ScheduleInterval extends Object
Interval definition forScheduleData
.
-
-
Constructor Summary
Constructors Constructor Description ScheduleInterval()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
IntervalUnit
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.ScheduleInterval
setUnit(IntervalUnit unit)
Set the interval time unit.ScheduleInterval
setValue(int value)
Set the interval duration.String
toString()
-
-
-
Method Detail
-
getValue
public int getValue()
Get the interval duration.- Returns:
- The interval duration.
-
setValue
public ScheduleInterval setValue(int value)
Set the interval duration.- Parameters:
value
- The interval duration.- Returns:
- fluent API
-
getUnit
public IntervalUnit getUnit()
Get the interval time unit.- Returns:
- The interval time unit.
-
setUnit
public ScheduleInterval setUnit(IntervalUnit unit)
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.
-
-