java.lang.Object
java.lang.Record
com.elex_project.chronos.TaskContext
public record TaskContext(String taskId, Runnable task, long interval, TimeUnit timeUnit, Set<DayOfWeek> daysOfWeek, int dayOfMonth, boolean isLastDayOfMonth, int hour, int minute, String cronExpression, long initialDelay, TimeUnit initialDelayUnit, OverlapPolicy policy, ChronosListener.Start startListener, ChronosListener.Success successListener, ChronosListener.Failure failureListener)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionTaskContext(String taskId, Runnable task, long interval, TimeUnit timeUnit, Set<DayOfWeek> daysOfWeek, int dayOfMonth, boolean isLastDayOfMonth, int hour, int minute, String cronExpression, long initialDelay, TimeUnit initialDelayUnit, OverlapPolicy policy, ChronosListener.Start startListener, ChronosListener.Success successListener, ChronosListener.Failure failureListener) Creates an instance of aTaskContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecronExpressionrecord component.intReturns the value of thedayOfMonthrecord component.Returns the value of thedaysOfWeekrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailureListenerrecord component.longlongfinal inthashCode()Returns a hash code value for this object.inthour()Returns the value of thehourrecord component.longReturns the value of theinitialDelayrecord component.Returns the value of theinitialDelayUnitrecord component.longinterval()Returns the value of theintervalrecord component.booleanisCron()booleanReturns the value of theisLastDayOfMonthrecord component.booleanbooleanisWeekly()intminute()Returns the value of theminuterecord component.policy()Returns the value of thepolicyrecord component.Returns the value of thestartListenerrecord component.Returns the value of thesuccessListenerrecord component.task()Returns the value of thetaskrecord component.taskId()Returns the value of thetaskIdrecord component.timeUnit()Returns the value of thetimeUnitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TaskContext
public TaskContext(String taskId, Runnable task, long interval, TimeUnit timeUnit, Set<DayOfWeek> daysOfWeek, int dayOfMonth, boolean isLastDayOfMonth, int hour, int minute, String cronExpression, long initialDelay, TimeUnit initialDelayUnit, OverlapPolicy policy, ChronosListener.Start startListener, ChronosListener.Success successListener, ChronosListener.Failure failureListener) Creates an instance of aTaskContextrecord class.- Parameters:
taskId- the value for thetaskIdrecord componenttask- the value for thetaskrecord componentinterval- the value for theintervalrecord componenttimeUnit- the value for thetimeUnitrecord componentdaysOfWeek- the value for thedaysOfWeekrecord componentdayOfMonth- the value for thedayOfMonthrecord componentisLastDayOfMonth- the value for theisLastDayOfMonthrecord componenthour- the value for thehourrecord componentminute- the value for theminuterecord componentcronExpression- the value for thecronExpressionrecord componentinitialDelay- the value for theinitialDelayrecord componentinitialDelayUnit- the value for theinitialDelayUnitrecord componentpolicy- the value for thepolicyrecord componentstartListener- the value for thestartListenerrecord componentsuccessListener- the value for thesuccessListenerrecord componentfailureListener- the value for thefailureListenerrecord component
-
-
Method Details
-
isWeekly
public boolean isWeekly() -
isMonthly
public boolean isMonthly() -
isCron
public boolean isCron() -
getIntervalMillis
public long getIntervalMillis() -
getInitialDelayMillis
public long getInitialDelayMillis() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
taskId
Returns the value of thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
task
Returns the value of thetaskrecord component.- Returns:
- the value of the
taskrecord component
-
interval
public long interval()Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
timeUnit
Returns the value of thetimeUnitrecord component.- Returns:
- the value of the
timeUnitrecord component
-
daysOfWeek
Returns the value of thedaysOfWeekrecord component.- Returns:
- the value of the
daysOfWeekrecord component
-
dayOfMonth
public int dayOfMonth()Returns the value of thedayOfMonthrecord component.- Returns:
- the value of the
dayOfMonthrecord component
-
isLastDayOfMonth
public boolean isLastDayOfMonth()Returns the value of theisLastDayOfMonthrecord component.- Returns:
- the value of the
isLastDayOfMonthrecord component
-
hour
public int hour()Returns the value of thehourrecord component.- Returns:
- the value of the
hourrecord component
-
minute
public int minute()Returns the value of theminuterecord component.- Returns:
- the value of the
minuterecord component
-
cronExpression
Returns the value of thecronExpressionrecord component.- Returns:
- the value of the
cronExpressionrecord component
-
initialDelay
public long initialDelay()Returns the value of theinitialDelayrecord component.- Returns:
- the value of the
initialDelayrecord component
-
initialDelayUnit
Returns the value of theinitialDelayUnitrecord component.- Returns:
- the value of the
initialDelayUnitrecord component
-
policy
Returns the value of thepolicyrecord component.- Returns:
- the value of the
policyrecord component
-
startListener
Returns the value of thestartListenerrecord component.- Returns:
- the value of the
startListenerrecord component
-
successListener
Returns the value of thesuccessListenerrecord component.- Returns:
- the value of the
successListenerrecord component
-
failureListener
Returns the value of thefailureListenerrecord component.- Returns:
- the value of the
failureListenerrecord component
-