Class ImmutableMessageCorrelationRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableMessageCorrelationRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, RecordValueWithVariables, MessageCorrelationRecordValue, ProcessInstanceRelated, TenantOwned

public final class ImmutableMessageCorrelationRecordValue extends Object implements MessageCorrelationRecordValue
Immutable implementation of MessageCorrelationRecordValue.

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

  • Method Details

    • getVariables

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

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

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

      public String getName()
      Specified by:
      getName in interface MessageCorrelationRecordValue
      Returns:
      the name of the message
    • getCorrelationKey

      public String getCorrelationKey()
      Specified by:
      getCorrelationKey in interface MessageCorrelationRecordValue
      Returns:
      the correlation key of the message
    • getMessageKey

      public long getMessageKey()
      Specified by:
      getMessageKey in interface MessageCorrelationRecordValue
      Returns:
      the key of the message
    • getRequestId

      public long getRequestId()
      Specified by:
      getRequestId in interface MessageCorrelationRecordValue
      Returns:
      the request id of the initial correlate command
    • getRequestStreamId

      public int getRequestStreamId()
      Specified by:
      getRequestStreamId in interface MessageCorrelationRecordValue
      Returns:
      the request stream id of the initial correlate command
    • withVariables

      public final ImmutableMessageCorrelationRecordValue 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
    • withTenantId

      public final ImmutableMessageCorrelationRecordValue 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
    • withProcessInstanceKey

      public final ImmutableMessageCorrelationRecordValue 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
    • withName

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

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

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

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMessageCorrelationRecordValue 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, tenantId, processInstanceKey, name, correlationKey, messageKey, requestId, requestStreamId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for ImmutableMessageCorrelationRecordValue.
       ImmutableMessageCorrelationRecordValue.builder()
          .putVariable|putAllVariables(String => Object) // variables mappings
          .withTenantId(String | null) // nullable tenantId
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withName(String | null) // nullable name
          .withCorrelationKey(String | null) // nullable correlationKey
          .withMessageKey(long) // optional messageKey
          .withRequestId(long) // optional requestId
          .withRequestStreamId(int) // optional requestStreamId
          .build();
       
      Returns:
      A new ImmutableMessageCorrelationRecordValue builder