Record Class TriggerAddedEvent
java.lang.Object
java.lang.Record
org.sterl.spring.persistent_tasks.trigger.event.TriggerAddedEvent
- All Implemented Interfaces:
PersistentTasksEvent,HasTrigger,TriggerLifeCycleEvent
public record TriggerAddedEvent(Long id, TriggerEntity data, Serializable state)
extends Record
implements TriggerLifeCycleEvent
Fired if a new trigger is added.
Inside a transaction, it is save to join or listen for the AFTER_COMMIT
-
Constructor Summary
ConstructorsConstructorDescriptionTriggerAddedEvent(Long id, TriggerEntity data, Serializable state) Creates an instance of aTriggerAddedEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisDone()If a trigger is done, it finished it's execution either successfully or with an final error without retries left.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.sterl.spring.persistent_tasks.shared.model.HasTrigger
executionCount, isRunning, key, newTaskId, shouldRunInFuture, statusMethods inherited from interface org.sterl.spring.persistent_tasks.trigger.event.TriggerLifeCycleEvent
getData, getId, timePassedMs
-
Constructor Details
-
Method Details
-
isDone
public boolean isDone()Description copied from interface:TriggerLifeCycleEventIf a trigger is done, it finished it's execution either successfully or with an final error without retries left.- Specified by:
isDonein interfaceTriggerLifeCycleEvent- Returns:
trueif the trigger was completed, either with success, error or canceled.
-
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). -
id
Returns the value of theidrecord component.- Specified by:
idin interfaceTriggerLifeCycleEvent- Returns:
- the value of the
idrecord component
-
data
Returns the value of thedatarecord component.- Specified by:
datain interfaceTriggerLifeCycleEvent- Returns:
- the value of the
datarecord component
-
state
Returns the value of thestaterecord component.- Specified by:
statein interfaceTriggerLifeCycleEvent- Returns:
- the value of the
staterecord component
-