Record Class RepeatingTaskMethod
java.lang.Object
java.lang.Record
com.thewinterframework.service.meta.scheduler.RepeatingTaskMethod
- Record Components:
service- The service classmethod- The method to executedelay- The delay before the task startsevery- The delay between each executionunit- The time unit of the delayasync- Whether the task should be executed
- All Implemented Interfaces:
SchedulerMethod
public record RepeatingTaskMethod(Class<?> service, AnnotatedMethodHandle<?> method, String delay, String every, String unit, String async)
extends Record
implements SchedulerMethod
Represents a repeating task method
-
Constructor Summary
ConstructorsConstructorDescriptionRepeatingTaskMethod(Class<?> service, AnnotatedMethodHandle<?> method, String delay, String every, String unit, String async) Creates an instance of aRepeatingTaskMethodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasync()Returns the value of theasyncrecord component.delay()Returns the value of thedelayrecord component.final booleanIndicates whether some other object is "equal to" this one.every()Returns the value of theeveryrecord component.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.intschedule(WinterPlugin plugin) Schedules this method to be executed by the plugin.Class<?> service()Returns the value of theservicerecord component.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord component.
-
Constructor Details
-
RepeatingTaskMethod
public RepeatingTaskMethod(Class<?> service, AnnotatedMethodHandle<?> method, String delay, String every, String unit, String async) Creates an instance of aRepeatingTaskMethodrecord class.- Parameters:
service- the value for theservicerecord componentmethod- the value for themethodrecord componentdelay- the value for thedelayrecord componentevery- the value for theeveryrecord componentunit- the value for theunitrecord componentasync- the value for theasyncrecord component
-
-
Method Details
-
schedule
Description copied from interface:SchedulerMethodSchedules this method to be executed by the plugin.- Specified by:
schedulein interfaceSchedulerMethod- Parameters:
plugin- Plugin to schedule this method for- Returns:
- The created schedule
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
service
Returns the value of theservicerecord component.- Returns:
- the value of the
servicerecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
delay
Returns the value of thedelayrecord component.- Returns:
- the value of the
delayrecord component
-
every
Returns the value of theeveryrecord component.- Returns:
- the value of the
everyrecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-
async
Returns the value of theasyncrecord component.- Returns:
- the value of the
asyncrecord component
-