Class ImmutableProcess
java.lang.Object
io.camunda.zeebe.protocol.record.value.deployment.ImmutableProcess
- All Implemented Interfaces:
JsonSerializable,RecordValue,Process,ProcessMetadataValue
@ParametersAreNonnullByDefault
@Immutable
public final class ImmutableProcess
extends Object
implements Process
Immutable implementation of
Process.
Use the builder to create immutable instances:
ImmutableProcess.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableProcess.Builderbuilder()Creates a builder forImmutableProcess.static ImmutableProcessCreates an immutable copy of aProcessvalue.booleanThis instance is equal to all instances ofImmutableProcessthat have equal attribute values.byte[]longbyte[]intinthashCode()Returns a lazily computed hash code from attributes:bpmnProcessId,version,processDefinitionKey,resourceName,checksum,duplicate,resource.booleanreturn true if the process is a duplicate (and has been deployed previously), false otherwisetoString()Prints the immutable valueProcesswith attribute values.final ImmutableProcesswithBpmnProcessId(String value) Copy the current immutable object by setting a value for thebpmnProcessIdattribute.final ImmutableProcesswithChecksum(byte... elements) Copy the current immutable object with elements that replace the content ofchecksum.final ImmutableProcesswithDuplicate(boolean value) Copy the current immutable object by setting a value for theduplicateattribute.final ImmutableProcesswithProcessDefinitionKey(long value) Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute.final ImmutableProcesswithResource(byte... elements) Copy the current immutable object with elements that replace the content ofresource.final ImmutableProcesswithResourceName(String value) Copy the current immutable object by setting a value for theresourceNameattribute.final ImmutableProcesswithVersion(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
-
getResource
public byte[] getResource()- Specified by:
getResourcein interfaceProcess- Returns:
- returns the corresponding binary resource
-
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
-
withResource
Copy the current immutable object with elements that replace the content ofresource. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for resource- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableProcessthat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:bpmnProcessId,version,processDefinitionKey,resourceName,checksum,duplicate,resource. -
toString
Prints the immutable valueProcesswith attribute values. -
copyOf
Creates an immutable copy of aProcessvalue. 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
Creates a builder forImmutableProcess.ImmutableProcess.builder() .withBpmnProcessId(String | null) // nullablebpmnProcessId.withVersion(int) // optionalversion.withProcessDefinitionKey(long) // optionalprocessDefinitionKey.withResourceName(String | null) // nullableresourceName.withChecksum(byte[] | null) // nullablechecksum.withDuplicate(boolean) // optionalduplicate.withResource(byte[] | null) // nullableresource.build();- Returns:
- A new ImmutableProcess builder
-