Class ImmutableProcessMetadataValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.deployment.ImmutableProcessMetadataValue
All Implemented Interfaces:
JsonSerializable, RecordValue, ProcessMetadataValue

@ParametersAreNonnullByDefault @Immutable public final class ImmutableProcessMetadataValue extends Object implements ProcessMetadataValue
Immutable implementation of ProcessMetadataValue.

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

  • Method Details

    • getBpmnProcessId

      public String getBpmnProcessId()
      Specified by:
      getBpmnProcessId in interface ProcessMetadataValue
      Returns:
      the bpmn process ID of this process
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface ProcessMetadataValue
      Returns:
      the version of this process
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface ProcessMetadataValue
      Returns:
      the key of this process
    • getResourceName

      public String getResourceName()
      Specified by:
      getResourceName in interface ProcessMetadataValue
      Returns:
      the name of the resource through which this process was deployed
    • getChecksum

      public byte[] getChecksum()
      Specified by:
      getChecksum in interface ProcessMetadataValue
      Returns:
      the checksum of the process (MD5)
    • isDuplicate

      public boolean isDuplicate()
      return true if the process is a duplicate (and has been deployed previously), false otherwise
      Specified by:
      isDuplicate in interface ProcessMetadataValue
    • withBpmnProcessId

      public final ImmutableProcessMetadataValue 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
    • withVersion

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

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

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

      public final ImmutableProcessMetadataValue withChecksum(byte... elements)
      Copy the current immutable object with elements that replace the content of checksum. The array is cloned before being saved as attribute values.
      Parameters:
      elements - The non-null elements for checksum
      Returns:
      A modified copy of this object
    • withDuplicate

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableProcessMetadataValue 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: bpmnProcessId, version, processDefinitionKey, resourceName, checksum, duplicate.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableProcessMetadataValue.Builder builder()
      Creates a builder for ImmutableProcessMetadataValue.
       ImmutableProcessMetadataValue.builder()
          .withBpmnProcessId(String | null) // nullable bpmnProcessId
          .withVersion(int) // optional version
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .withResourceName(String | null) // nullable resourceName
          .withChecksum(byte[] | null) // nullable checksum
          .withDuplicate(boolean) // optional duplicate
          .build();
       
      Returns:
      A new ImmutableProcessMetadataValue builder