Class ImmutableMessageBatchRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableMessageBatchRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, MessageBatchRecordValue

public final class ImmutableMessageBatchRecordValue extends Object implements MessageBatchRecordValue
Immutable implementation of MessageBatchRecordValue.

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

  • Method Details

    • getMessageKeys

      public List<Long> getMessageKeys()
      Specified by:
      getMessageKeys in interface MessageBatchRecordValue
      Returns:
      list of the keys from the messages assigned to this batch
    • withMessageKeys

      public final ImmutableMessageBatchRecordValue withMessageKeys(Long... elements)
      Copy the current immutable object with elements that replace the content of messageKeys.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMessageKeys

      public final ImmutableMessageBatchRecordValue withMessageKeys(Iterable<? extends Long> elements)
      Copy the current immutable object with elements that replace the content of messageKeys. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of messageKeys elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMessageBatchRecordValue 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: messageKeys.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for ImmutableMessageBatchRecordValue.
       ImmutableMessageBatchRecordValue.builder()
          .addMessageKey|addAllMessageKeys(Long) // messageKeys elements
          .build();
       
      Returns:
      A new ImmutableMessageBatchRecordValue builder