Class ImmutableCommandDistributionRecordValue

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

@ParametersAreNonnullByDefault @Immutable public final class ImmutableCommandDistributionRecordValue extends Object implements CommandDistributionRecordValue
Immutable implementation of CommandDistributionRecordValue.

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

  • Method Details

    • getPartitionId

      public int getPartitionId()
      Specified by:
      getPartitionId in interface CommandDistributionRecordValue
      Returns:
      the partition where the record should be distributed to
    • getValueType

      public ValueType getValueType()
      Specified by:
      getValueType in interface CommandDistributionRecordValue
      Returns:
      the wrapped record value type
    • getCommandValue

      public RecordValue getCommandValue()
      Specified by:
      getCommandValue in interface CommandDistributionRecordValue
      Returns:
      the wrapped record value
    • withPartitionId

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

      public final ImmutableCommandDistributionRecordValue withValueType(ValueType value)
      Copy the current immutable object by setting a value for the valueType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for valueType (can be null)
      Returns:
      A modified copy of the this object
    • withCommandValue

      public final ImmutableCommandDistributionRecordValue withCommandValue(RecordValue value)
      Copy the current immutable object by setting a value for the commandValue attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for commandValue (can be null)
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableCommandDistributionRecordValue 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: partitionId, valueType, commandValue.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      Creates a builder for ImmutableCommandDistributionRecordValue.
       ImmutableCommandDistributionRecordValue.builder()
          .withPartitionId(int) // optional partitionId
          .withValueType(io.camunda.zeebe.protocol.record.ValueType | null) // nullable valueType
          .withCommandValue(io.camunda.zeebe.protocol.record.RecordValue | null) // nullable commandValue
          .build();
       
      Returns:
      A new ImmutableCommandDistributionRecordValue builder