Class ImmutableCommandDistributionRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableCommandDistributionRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,CommandDistributionRecordValue
public final class ImmutableCommandDistributionRecordValue
extends Object
implements CommandDistributionRecordValue
Immutable implementation of
CommandDistributionRecordValue.
Use the builder to create immutable instances:
ImmutableCommandDistributionRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCommandDistributionRecordValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableCommandDistributionRecordValue.copyOf(CommandDistributionRecordValue instance) Creates an immutable copy of aCommandDistributionRecordValuevalue.booleanThis instance is equal to all instances ofImmutableCommandDistributionRecordValuethat have equal attribute values.intinthashCode()Returns a lazily computed hash code from attributes:partitionId,queueId,valueType,intent,commandValue.toString()Prints the immutable valueCommandDistributionRecordValuewith attribute values.withCommandValue(RecordValue value) Copy the current immutable object by setting a value for thecommandValueattribute.withIntent(Intent value) Copy the current immutable object by setting a value for theintentattribute.withPartitionId(int value) Copy the current immutable object by setting a value for thepartitionIdattribute.withQueueId(String value) Copy the current immutable object by setting a value for thequeueIdattribute.withValueType(ValueType value) Copy the current immutable object by setting a value for thevalueTypeattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getPartitionId
public int getPartitionId()- Specified by:
getPartitionIdin interfaceCommandDistributionRecordValue- Returns:
- the partition where the record should be distributed to
-
getQueueId
- Specified by:
getQueueIdin interfaceCommandDistributionRecordValue- Returns:
- the queue id for this distribution or null if the queue id is not set.
-
getValueType
- Specified by:
getValueTypein interfaceCommandDistributionRecordValue- Returns:
- the wrapped record value type
-
getIntent
- Specified by:
getIntentin interfaceCommandDistributionRecordValue- Returns:
- the wrapped intent
-
getCommandValue
- Specified by:
getCommandValuein interfaceCommandDistributionRecordValue- Returns:
- the wrapped record value
-
withPartitionId
Copy the current immutable object by setting a value for thepartitionIdattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for partitionId- Returns:
- A modified copy of the
thisobject
-
withQueueId
Copy the current immutable object by setting a value for thequeueIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for queueId (can benull)- Returns:
- A modified copy of the
thisobject
-
withValueType
Copy the current immutable object by setting a value for thevalueTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valueType (can benull)- Returns:
- A modified copy of the
thisobject
-
withIntent
Copy the current immutable object by setting a value for theintentattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for intent (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommandValue
Copy the current immutable object by setting a value for thecommandValueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commandValue (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableCommandDistributionRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:partitionId,queueId,valueType,intent,commandValue. -
toString
Prints the immutable valueCommandDistributionRecordValuewith attribute values. -
copyOf
public static ImmutableCommandDistributionRecordValue copyOf(CommandDistributionRecordValue instance) Creates an immutable copy of aCommandDistributionRecordValuevalue. 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 forImmutableCommandDistributionRecordValue.ImmutableCommandDistributionRecordValue.builder() .withPartitionId(int) // optionalpartitionId.withQueueId(String | null) // nullablequeueId.withValueType(io.camunda.zeebe.protocol.record.ValueType | null) // nullablevalueType.withIntent(io.camunda.zeebe.protocol.record.intent.Intent | null) // nullableintent.withCommandValue(io.camunda.zeebe.protocol.record.RecordValue | null) // nullablecommandValue.build();- Returns:
- A new ImmutableCommandDistributionRecordValue builder
-