Class ImmutableTimerRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableTimerRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,ProcessInstanceRelated,TimerRecordValue
@ParametersAreNonnullByDefault
@Immutable
public final class ImmutableTimerRecordValue
extends Object
implements TimerRecordValue
Immutable implementation of
TimerRecordValue.
Use the builder to create immutable instances:
ImmutableTimerRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableTimerRecordValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableTimerRecordValue.static ImmutableTimerRecordValuecopyOf(TimerRecordValue instance) Creates an immutable copy of aTimerRecordValuevalue.booleanThis instance is equal to all instances ofImmutableTimerRecordValuethat have equal attribute values.longlonglonglongintThe handlerFlowNodeID property represent the ID, from the BPMN XML of the process, of the flow node which will handle the timer trigger's event.inthashCode()Returns a lazily computed hash code from attributes:processDefinitionKey,elementInstanceKey,processInstanceKey,dueDate,targetElementId,repetitions.toString()Prints the immutable valueTimerRecordValuewith attribute values.withDueDate(long value) Copy the current immutable object by setting a value for thedueDateattribute.withElementInstanceKey(long value) Copy the current immutable object by setting a value for theelementInstanceKeyattribute.withProcessDefinitionKey(long value) Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute.withProcessInstanceKey(long value) Copy the current immutable object by setting a value for theprocessInstanceKeyattribute.withRepetitions(int value) Copy the current immutable object by setting a value for therepetitionsattribute.withTargetElementId(String value) Copy the current immutable object by setting a value for thetargetElementIdattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getProcessDefinitionKey
public long getProcessDefinitionKey()- Specified by:
getProcessDefinitionKeyin interfaceTimerRecordValue- Returns:
- the key of the process in which this timer was created
-
getElementInstanceKey
public long getElementInstanceKey()- Specified by:
getElementInstanceKeyin interfaceTimerRecordValue- Returns:
- the key of the related element instance.
-
getProcessInstanceKey
public long getProcessInstanceKey()- Specified by:
getProcessInstanceKeyin interfaceProcessInstanceRelated- Specified by:
getProcessInstanceKeyin interfaceTimerRecordValue- Returns:
- the key of the related process instance
-
getDueDate
public long getDueDate()- Specified by:
getDueDatein interfaceTimerRecordValue- Returns:
- the due date of the timer as Unix timestamp in millis.
-
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:
getTargetElementIdin interfaceTimerRecordValue- Returns:
- the ID of the flow node which will handle the trigger element
-
getRepetitions
public int getRepetitions()- Specified by:
getRepetitionsin interfaceTimerRecordValue- Returns:
- the number of times this timer should trigger
-
withProcessDefinitionKey
Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processDefinitionKey- Returns:
- A modified copy of the
thisobject
-
withElementInstanceKey
Copy the current immutable object by setting a value for theelementInstanceKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for elementInstanceKey- Returns:
- A modified copy of the
thisobject
-
withProcessInstanceKey
Copy the current immutable object by setting a value for theprocessInstanceKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processInstanceKey- Returns:
- A modified copy of the
thisobject
-
withDueDate
Copy the current immutable object by setting a value for thedueDateattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for dueDate- Returns:
- A modified copy of the
thisobject
-
withTargetElementId
Copy the current immutable object by setting a value for thetargetElementIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for targetElementId (can benull)- Returns:
- A modified copy of the
thisobject
-
withRepetitions
Copy the current immutable object by setting a value for therepetitionsattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repetitions- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableTimerRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:processDefinitionKey,elementInstanceKey,processInstanceKey,dueDate,targetElementId,repetitions. -
toString
Prints the immutable valueTimerRecordValuewith attribute values. -
copyOf
Creates an immutable copy of aTimerRecordValuevalue. 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
Creates a builder forImmutableTimerRecordValue.ImmutableTimerRecordValue.builder() .withProcessDefinitionKey(long) // optionalprocessDefinitionKey.withElementInstanceKey(long) // optionalelementInstanceKey.withProcessInstanceKey(long) // optionalprocessInstanceKey.withDueDate(long) // optionaldueDate.withTargetElementId(String | null) // nullabletargetElementId.withRepetitions(int) // optionalrepetitions.build();- Returns:
- A new ImmutableTimerRecordValue builder
-