Class ImmutableFormMetadataValue

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

public final class ImmutableFormMetadataValue extends Object implements FormMetadataValue
Immutable implementation of FormMetadataValue.

Use the builder to create immutable instances: ImmutableFormMetadataValue.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
    • withTenantId

      public final ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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 ImmutableFormMetadataValue 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
    • equals

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

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

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

      public static ImmutableFormMetadataValue.Builder builder()
      Creates a builder for ImmutableFormMetadataValue.
       ImmutableFormMetadataValue.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
          .build();
       
      Returns:
      A new ImmutableFormMetadataValue builder