Record Class RepositoryArtifactChunk
java.lang.Object
java.lang.Record
org.j7m.middleware.application.api.replication.RepositoryArtifactChunk
- Record Components:
transferId- stable transfer identifierdigest- artifact digest descriptorsequence- zero-based chunk sequencetotalChunks- total chunk countchunkDigest- SHA-256 digest of this chunk payloadbytes- chunk bytes, defensively copied
- All Implemented Interfaces:
Serializable
public record RepositoryArtifactChunk(String transferId, RepositoryArtifactDigest digest, int sequence, int totalChunks, String chunkDigest, byte[] bytes)
extends Record
implements Serializable
Bounded artifact transfer chunk.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryArtifactChunk(String transferId, RepositoryArtifactDigest digest, int sequence, int totalChunks, String chunkDigest, byte[] bytes) Creates a validated immutable chunk.RepositoryArtifactChunk(RepositoryArtifactDigest digest, int sequence, int totalChunks, byte[] bytes) Compatibility constructor for callers that do not provide transfer or chunk-digest metadata. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Returns a defensive copy of the chunk bytes.Returns the value of thechunkDigestrecord component.digest()Returns the value of thedigestrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalChunksrecord component.Returns the value of thetransferIdrecord component.
-
Constructor Details
-
RepositoryArtifactChunk
public RepositoryArtifactChunk(String transferId, RepositoryArtifactDigest digest, int sequence, int totalChunks, String chunkDigest, byte[] bytes) Creates a validated immutable chunk. -
RepositoryArtifactChunk
public RepositoryArtifactChunk(RepositoryArtifactDigest digest, int sequence, int totalChunks, byte[] bytes) Compatibility constructor for callers that do not provide transfer or chunk-digest metadata.- Parameters:
digest- artifact digest descriptorsequence- zero-based chunk sequencetotalChunks- total chunk countbytes- chunk bytes
-
-
Method Details
-
bytes
public byte[] bytes()Returns a defensive copy of the chunk bytes.- Returns:
- chunk bytes
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
transferId
Returns the value of thetransferIdrecord component.- Returns:
- the value of the
transferIdrecord component
-
digest
-
sequence
-
totalChunks
public int totalChunks()Returns the value of thetotalChunksrecord component.- Returns:
- the value of the
totalChunksrecord component
-
chunkDigest
Returns the value of thechunkDigestrecord component.- Returns:
- the value of the
chunkDigestrecord component
-