Class ImmutableProcessEventRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableProcessEventRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, RecordValueWithVariables, ProcessEventRecordValue, ProcessInstanceRelated

@ParametersAreNonnullByDefault @Immutable public final class ImmutableProcessEventRecordValue extends Object implements ProcessEventRecordValue
Immutable implementation of ProcessEventRecordValue.

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

  • Method Details

    • getVariables

      public Map<String,Object> getVariables()
      Specified by:
      getVariables in interface RecordValueWithVariables
      Returns:
      the variables of this record. Can be empty.
    • getProcessInstanceKey

      public long getProcessInstanceKey()
      Specified by:
      getProcessInstanceKey in interface ProcessInstanceRelated
      Returns:
      the key of the corresponding process instance
    • getScopeKey

      public long getScopeKey()
      Specified by:
      getScopeKey in interface ProcessEventRecordValue
      Returns:
      the key identifying the event's scope
    • getTargetElementId

      public String getTargetElementId()
      Specified by:
      getTargetElementId in interface ProcessEventRecordValue
      Returns:
      the ID of the element which should react to the event
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface ProcessEventRecordValue
      Returns:
      the key of the deployed process this instance belongs to.
    • withVariables

      public final ImmutableProcessEventRecordValue withVariables(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the variables map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the variables map
      Returns:
      A modified copy of this object
    • withProcessInstanceKey

      public final ImmutableProcessEventRecordValue 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
    • withScopeKey

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

      public final ImmutableProcessEventRecordValue 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
    • withProcessDefinitionKey

      public final ImmutableProcessEventRecordValue 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableProcessEventRecordValue 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: variables, processInstanceKey, scopeKey, targetElementId, processDefinitionKey.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a ProcessEventRecordValue 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 ProcessEventRecordValue instance
    • builder

      Creates a builder for ImmutableProcessEventRecordValue.
       ImmutableProcessEventRecordValue.builder()
          .putVariable|putAllVariables(String => Object) // variables mappings
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withScopeKey(long) // optional scopeKey
          .withTargetElementId(String | null) // nullable targetElementId
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .build();
       
      Returns:
      A new ImmutableProcessEventRecordValue builder