Class ImmutableDeploymentResource
java.lang.Object
io.camunda.zeebe.protocol.record.value.deployment.ImmutableDeploymentResource
- All Implemented Interfaces:
DeploymentResource
Immutable implementation of
DeploymentResource.
Use the builder to create immutable instances:
ImmutableDeploymentResource.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableDeploymentResource. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableDeploymentResource.static ImmutableDeploymentResourcecopyOf(DeploymentResource instance) Creates an immutable copy of aDeploymentResourcevalue.booleanThis instance is equal to all instances ofImmutableDeploymentResourcethat have equal attribute values.byte[]inthashCode()Returns a lazily computed hash code from attributes:resource,resourceName.toString()Prints the immutable valueDeploymentResourcewith attribute values.withResource(byte... elements) Copy the current immutable object with elements that replace the content ofresource.withResourceName(String value) Copy the current immutable object by setting a value for theresourceNameattribute.
-
Method Details
-
getResource
public byte[] getResource()- Specified by:
getResourcein interfaceDeploymentResource- Returns:
- the resource contents
-
getResourceName
- Specified by:
getResourceNamein interfaceDeploymentResource- Returns:
- the name of the resource
-
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
-
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
-
equals
This instance is equal to all instances ofImmutableDeploymentResourcethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:resource,resourceName. -
toString
Prints the immutable valueDeploymentResourcewith attribute values. -
copyOf
Creates an immutable copy of aDeploymentResourcevalue. 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 DeploymentResource instance
-
builder
Creates a builder forImmutableDeploymentResource.ImmutableDeploymentResource.builder() .withResource(byte[] | null) // nullableresource.withResourceName(String | null) // nullableresourceName.build();- Returns:
- A new ImmutableDeploymentResource builder
-