Record Class RunTaskWithStateCommand

java.lang.Object
java.lang.Record
org.sterl.spring.persistent_tasks.trigger.model.RunTaskWithStateCommand
All Implemented Interfaces:
HasTriggerData

public record RunTaskWithStateCommand(PersistentTask<Serializable> task, Optional<org.springframework.transaction.support.TransactionTemplate> trx, Serializable state, TriggerEntity trigger, RunningTrigger<Serializable> runningTrigger) extends Record implements HasTriggerData
  • Constructor Details

    • RunTaskWithStateCommand

      public RunTaskWithStateCommand(PersistentTask<Serializable> task, Optional<org.springframework.transaction.support.TransactionTemplate> trx, Serializable state, TriggerEntity trigger)
    • RunTaskWithStateCommand

      public RunTaskWithStateCommand(PersistentTask<Serializable> task, Optional<org.springframework.transaction.support.TransactionTemplate> trx, Serializable state, TriggerEntity trigger, RunningTrigger<Serializable> runningTrigger)
      Creates an instance of a RunTaskWithStateCommand record class.
      Parameters:
      task - the value for the task record component
      trx - the value for the trx record component
      state - the value for the state record component
      trigger - the value for the trigger record component
      runningTrigger - the value for the runningTrigger record component
  • Method Details

    • execute

      public Optional<TriggerEntity> execute(EditTriggerComponent editTrigger)
    • getData

      public TriggerData getData()
      Specified by:
      getData in interface HasTriggerData
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • task

      public PersistentTask<Serializable> task()
      Returns the value of the task record component.
      Returns:
      the value of the task record component
    • trx

      public Optional<org.springframework.transaction.support.TransactionTemplate> trx()
      Returns the value of the trx record component.
      Returns:
      the value of the trx record component
    • state

      public Serializable state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • trigger

      public TriggerEntity trigger()
      Returns the value of the trigger record component.
      Returns:
      the value of the trigger record component
    • runningTrigger

      public RunningTrigger<Serializable> runningTrigger()
      Returns the value of the runningTrigger record component.
      Returns:
      the value of the runningTrigger record component