Record Class TriggerAddedEvent
java.lang.Object
java.lang.Record
org.sterl.spring.persistent_tasks.trigger.event.TriggerAddedEvent
- All Implemented Interfaces:
PersistentTasksEvent
,HasTriggerData
,TriggerLifeCycleEvent
public record TriggerAddedEvent(long id, TriggerData 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, TriggerData data, Serializable state) Creates an instance of aTriggerAddedEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
id()
Returns the value of theid
record component.boolean
isDone()
state()
Returns the value of thestate
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.sterl.spring.persistent_tasks.shared.model.HasTriggerData
executionCount, isRunning, key, newTaskId, shouldRunInFuture, status
Methods inherited from interface org.sterl.spring.persistent_tasks.trigger.event.TriggerLifeCycleEvent
getData
-
Constructor Details
-
Method Details
-
isDone
public boolean isDone()- Specified by:
isDone
in interfaceTriggerLifeCycleEvent
- Returns:
true
if 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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
id
public long id()Returns the value of theid
record component.- Specified by:
id
in interfaceTriggerLifeCycleEvent
- Returns:
- the value of the
id
record component
-
data
Returns the value of thedata
record component.- Specified by:
data
in interfaceTriggerLifeCycleEvent
- Returns:
- the value of the
data
record component
-
state
Returns the value of thestate
record component.- Specified by:
state
in interfaceTriggerLifeCycleEvent
- Returns:
- the value of the
state
record component
-