java.lang.Object
io.camunda.zeebe.protocol.record.value.deployment.ImmutableForm
All Implemented Interfaces:
JsonSerializable, RecordValue, Form, FormMetadataValue, TenantOwned

public final class ImmutableForm extends Object implements Form
Immutable implementation of Form.

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

  • Method Details

    • getTenantId

      public String getTenantId()
      Returns the identifier of the tenant that owns this entity.
      Specified by:
      getTenantId in interface TenantOwned
    • getFormId

      public String getFormId()
      Specified by:
      getFormId in interface FormMetadataValue
      Returns:
      the ID of the form
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface FormMetadataValue
      Returns:
      the version of the deployed form
    • getVersionTag

      public String getVersionTag()
      Specified by:
      getVersionTag in interface FormMetadataValue
      Returns:
      the custom version tag of the form
    • getFormKey

      public long getFormKey()
      Specified by:
      getFormKey in interface FormMetadataValue
      Returns:
      the key of the deployed form
    • getResourceName

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

      public byte[] getChecksum()
      Specified by:
      getChecksum in interface FormMetadataValue
      Returns:
      the checksum of the form resource (MD5)
    • isDuplicate

      public boolean isDuplicate()
      Specified by:
      isDuplicate in interface FormMetadataValue
      Returns:
      true if the form is a duplicate (and has been deployed previously), otherwise false
    • getDeploymentKey

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

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

      public final ImmutableForm 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
    • withFormId

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

      public final ImmutableForm 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 ImmutableForm 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
    • withFormKey

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

      public final ImmutableForm 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 ImmutableForm 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 ImmutableForm 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 ImmutableForm 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 ImmutableForm 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 ImmutableForm 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, formId, version, versionTag, formKey, resourceName, checksum, duplicate, deploymentKey, resource.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableForm.Builder builder()
      Creates a builder for ImmutableForm.
       ImmutableForm.builder()
          .withTenantId(String | null) // nullable tenantId
          .withFormId(String | null) // nullable formId
          .withVersion(int) // optional version
          .withVersionTag(String | null) // nullable versionTag
          .withFormKey(long) // optional formKey
          .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 ImmutableForm builder