Class ImmutableMessageSubscriptionRecordValue

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

@ParametersAreNonnullByDefault @Immutable public final class ImmutableMessageSubscriptionRecordValue extends Object implements MessageSubscriptionRecordValue
Immutable implementation of MessageSubscriptionRecordValue.

Use the builder to create immutable instances: ImmutableMessageSubscriptionRecordValue.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 MessageSubscriptionRecordValue
      Specified by:
      getProcessInstanceKey in interface ProcessInstanceRelated
      Returns:
      the process instance key tied to the subscription
    • getElementInstanceKey

      public long getElementInstanceKey()
      Specified by:
      getElementInstanceKey in interface MessageSubscriptionRecordValue
      Returns:
      the element instance key tied to the subscription
    • getBpmnProcessId

      public String getBpmnProcessId()
      Specified by:
      getBpmnProcessId in interface MessageSubscriptionRecordValue
      Returns:
      the BPMN process id tied to the subscription
    • getMessageName

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

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

      public long getMessageKey()
      Specified by:
      getMessageKey in interface MessageSubscriptionRecordValue
      Returns:
      the key of the correlated message
    • isInterrupting

      public boolean isInterrupting()
      Specified by:
      isInterrupting in interface MessageSubscriptionRecordValue
      Returns:
      true if the event tied to the subscription is interrupting. Otherwise, it returns false if the event is non-interrupting.
    • withVariables

      public final ImmutableMessageSubscriptionRecordValue 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 ImmutableMessageSubscriptionRecordValue 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
    • withElementInstanceKey

      public final ImmutableMessageSubscriptionRecordValue 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
    • withBpmnProcessId

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

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

      public final ImmutableMessageSubscriptionRecordValue 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 ImmutableMessageSubscriptionRecordValue 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
    • withInterrupting

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableMessageSubscriptionRecordValue 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, elementInstanceKey, bpmnProcessId, messageName, correlationKey, messageKey, interrupting.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for ImmutableMessageSubscriptionRecordValue.
       ImmutableMessageSubscriptionRecordValue.builder()
          .putVariable|putAllVariables(String => Object) // variables mappings
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withElementInstanceKey(long) // optional elementInstanceKey
          .withBpmnProcessId(String | null) // nullable bpmnProcessId
          .withMessageName(String | null) // nullable messageName
          .withCorrelationKey(String | null) // nullable correlationKey
          .withMessageKey(long) // optional messageKey
          .withInterrupting(boolean) // optional interrupting
          .build();
       
      Returns:
      A new ImmutableMessageSubscriptionRecordValue builder