Class ImmutableTimerRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableTimerRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, ProcessInstanceRelated, TenantOwned, TimerRecordValue

public final class ImmutableTimerRecordValue extends Object implements TimerRecordValue
Immutable implementation of TimerRecordValue.

Use the builder to create immutable instances: ImmutableTimerRecordValue.builder().

  • Method Details

    • getTenantId

      public String getTenantId()
      Returns the identifier of the tenant that owns this entity.
      Specified by:
      getTenantId in interface TenantOwned
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface TimerRecordValue
      Returns:
      the key of the process in which this timer was created
    • getElementInstanceKey

      public long getElementInstanceKey()
      Specified by:
      getElementInstanceKey in interface TimerRecordValue
      Returns:
      the key of the related element instance.
    • getProcessInstanceKey

      public long getProcessInstanceKey()
      Specified by:
      getProcessInstanceKey in interface ProcessInstanceRelated
      Specified by:
      getProcessInstanceKey in interface TimerRecordValue
      Returns:
      the key of the related process instance
    • getDueDate

      public long getDueDate()
      Specified by:
      getDueDate in interface TimerRecordValue
      Returns:
      the due date of the timer as Unix timestamp in millis.
    • getTargetElementId

      public String getTargetElementId()
      The handlerFlowNodeID property represent the ID, from the BPMN XML of the process, of the flow node which will handle the timer trigger's event. In normal flow, this is usually the same as the related activity's ID, but when the timer was created due to a boundary event, it will be that event's ID.
      Specified by:
      getTargetElementId in interface TimerRecordValue
      Returns:
      the ID of the flow node which will handle the trigger element
    • getRepetitions

      public int getRepetitions()
      Specified by:
      getRepetitions in interface TimerRecordValue
      Returns:
      the number of times this timer should trigger
    • withTenantId

      public final ImmutableTimerRecordValue withTenantId(String value)
      Copy the current immutable object by setting a value for the tenantId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tenantId (can be null)
      Returns:
      A modified copy of the this object
    • withProcessDefinitionKey

      public final ImmutableTimerRecordValue withProcessDefinitionKey(long value)
      Copy the current immutable object by setting a value for the processDefinitionKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for processDefinitionKey
      Returns:
      A modified copy of the this object
    • withElementInstanceKey

      public final ImmutableTimerRecordValue withElementInstanceKey(long value)
      Copy the current immutable object by setting a value for the elementInstanceKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for elementInstanceKey
      Returns:
      A modified copy of the this object
    • withProcessInstanceKey

      public final ImmutableTimerRecordValue withProcessInstanceKey(long value)
      Copy the current immutable object by setting a value for the processInstanceKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for processInstanceKey
      Returns:
      A modified copy of the this object
    • withDueDate

      public final ImmutableTimerRecordValue withDueDate(long value)
      Copy the current immutable object by setting a value for the dueDate attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dueDate
      Returns:
      A modified copy of the this object
    • withTargetElementId

      public final ImmutableTimerRecordValue withTargetElementId(String value)
      Copy the current immutable object by setting a value for the targetElementId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for targetElementId (can be null)
      Returns:
      A modified copy of the this object
    • withRepetitions

      public final ImmutableTimerRecordValue withRepetitions(int value)
      Copy the current immutable object by setting a value for the repetitions attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for repetitions
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableTimerRecordValue that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Returns a lazily computed hash code from attributes: tenantId, processDefinitionKey, elementInstanceKey, processInstanceKey, dueDate, targetElementId, repetitions.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TimerRecordValue with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableTimerRecordValue copyOf(TimerRecordValue instance)
      Creates an immutable copy of a TimerRecordValue value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable TimerRecordValue instance
    • builder

      public static ImmutableTimerRecordValue.Builder builder()
      Creates a builder for ImmutableTimerRecordValue.
       ImmutableTimerRecordValue.builder()
          .withTenantId(String | null) // nullable tenantId
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .withElementInstanceKey(long) // optional elementInstanceKey
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withDueDate(long) // optional dueDate
          .withTargetElementId(String | null) // nullable targetElementId
          .withRepetitions(int) // optional repetitions
          .build();
       
      Returns:
      A new ImmutableTimerRecordValue builder