Class ImmutableProcess

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

public final class ImmutableProcess extends Object implements Process
Immutable implementation of Process.

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

  • Method Details

    • getTenantId

      public String getTenantId()
      Returns the identifier of the tenant that owns this entity.
      Specified by:
      getTenantId in interface TenantOwned
    • 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
    • getVersionTag

      public String getVersionTag()
      Specified by:
      getVersionTag in interface ProcessMetadataValue
      Returns:
      the custom version tag 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
    • getDeploymentKey

      public long getDeploymentKey()
      Specified by:
      getDeploymentKey in interface ProcessMetadataValue
      Returns:
      the key of the deployment this process was deployed with
    • getResource

      public byte[] getResource()
      Specified by:
      getResource in interface Process
      Returns:
      returns the corresponding binary resource
    • withTenantId

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

      public final ImmutableProcess 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 ImmutableProcess 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
    • withVersionTag

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

      public final ImmutableProcess 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 ImmutableProcess 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 ImmutableProcess 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 ImmutableProcess 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
    • withDeploymentKey

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

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

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

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

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

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