Class ImmutableCheckpointRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.management.ImmutableCheckpointRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, CheckpointRecordValue

@ParametersAreNonnullByDefault @Immutable public final class ImmutableCheckpointRecordValue extends Object implements CheckpointRecordValue
Immutable implementation of CheckpointRecordValue.

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

  • Method Details

    • getCheckpointId

      public long getCheckpointId()
      Specified by:
      getCheckpointId in interface CheckpointRecordValue
      Returns:
      id of the checkpoint
    • getCheckpointPosition

      public long getCheckpointPosition()
      Specified by:
      getCheckpointPosition in interface CheckpointRecordValue
      Returns:
      the position of the checkpoint
    • withCheckpointId

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

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

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

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

      public static ImmutableCheckpointRecordValue copyOf(CheckpointRecordValue instance)
      Creates an immutable copy of a CheckpointRecordValue 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 CheckpointRecordValue instance
    • builder

      public static ImmutableCheckpointRecordValue.Builder builder()
      Creates a builder for ImmutableCheckpointRecordValue.
       ImmutableCheckpointRecordValue.builder()
          .withCheckpointId(long) // optional checkpointId
          .withCheckpointPosition(long) // optional checkpointPosition
          .build();
       
      Returns:
      A new ImmutableCheckpointRecordValue builder