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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableProcessMetadataValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableProcessMetadataValue.copyOf(ProcessMetadataValue instance) Creates an immutable copy of aProcessMetadataValuevalue.booleanThis instance is equal to all instances ofImmutableProcessMetadataValuethat have equal attribute values.byte[]longintinthashCode()Returns a lazily computed hash code from attributes:bpmnProcessId,version,processDefinitionKey,resourceName,checksum,duplicate.booleanreturn true if the process is a duplicate (and has been deployed previously), false otherwisetoString()Prints the immutable valueProcessMetadataValuewith attribute values.withBpmnProcessId(String value) Copy the current immutable object by setting a value for thebpmnProcessIdattribute.withChecksum(byte... elements) Copy the current immutable object with elements that replace the content ofchecksum.withDuplicate(boolean value) Copy the current immutable object by setting a value for theduplicateattribute.withProcessDefinitionKey(long value) Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute.withResourceName(String value) Copy the current immutable object by setting a value for theresourceNameattribute.withVersion(int value) Copy the current immutable object by setting a value for theversionattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getBpmnProcessId
- Specified by:
getBpmnProcessIdin interfaceProcessMetadataValue- Returns:
- the bpmn process ID of this process
-
getVersion
public int getVersion()- Specified by:
getVersionin interfaceProcessMetadataValue- Returns:
- the version of this process
-
getProcessDefinitionKey
public long getProcessDefinitionKey()- Specified by:
getProcessDefinitionKeyin interfaceProcessMetadataValue- Returns:
- the key of this process
-
getResourceName
- Specified by:
getResourceNamein interfaceProcessMetadataValue- Returns:
- the name of the resource through which this process was deployed
-
getChecksum
public byte[] getChecksum()- Specified by:
getChecksumin interfaceProcessMetadataValue- 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:
isDuplicatein interfaceProcessMetadataValue
-
withBpmnProcessId
Copy the current immutable object by setting a value for thebpmnProcessIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bpmnProcessId (can benull)- Returns:
- A modified copy of the
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withProcessDefinitionKey
Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processDefinitionKey- Returns:
- A modified copy of the
thisobject
-
withResourceName
Copy the current immutable object by setting a value for theresourceNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for resourceName (can benull)- Returns:
- A modified copy of the
thisobject
-
withChecksum
Copy the current immutable object with elements that replace the content ofchecksum. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for checksum- Returns:
- A modified copy of
thisobject
-
withDuplicate
Copy the current immutable object by setting a value for theduplicateattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for duplicate- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableProcessMetadataValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:bpmnProcessId,version,processDefinitionKey,resourceName,checksum,duplicate. -
toString
Prints the immutable valueProcessMetadataValuewith attribute values. -
copyOf
Creates an immutable copy of aProcessMetadataValuevalue. 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
Creates a builder forImmutableProcessMetadataValue.ImmutableProcessMetadataValue.builder() .withBpmnProcessId(String | null) // nullablebpmnProcessId.withVersion(int) // optionalversion.withProcessDefinitionKey(long) // optionalprocessDefinitionKey.withResourceName(String | null) // nullableresourceName.withChecksum(byte[] | null) // nullablechecksum.withDuplicate(boolean) // optionalduplicate.build();- Returns:
- A new ImmutableProcessMetadataValue builder
-