Class DittoAttachmentToken
java.lang.Object
com.ditto.java.DittoAttachmentToken
Represents a reference token for a specific attachment in the Ditto store.
An attachment token serves as a handle to an attachment and contains metadata about it,
including its unique identifier, size, and custom metadata. You can pass this token to
DittoStore.fetchAttachment(DittoAttachmentToken)
to download the attachment data from remote peers.
Attachment tokens are typically obtained from document properties that reference attachments.
-
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull StringgetId()Returns the attachment's unique identifier.@NonNull DittoULongReturns the length (size) of the attachment in bytes.@NonNull DittoCborSerializable.DictionaryReturns the attachment's metadata.inthashCode()
-
Method Details
-
getId
Returns the attachment's unique identifier.- Returns:
- the attachment ID as a string.
-
getLength
Returns the length (size) of the attachment in bytes.- Returns:
- the attachment size as an unsigned long.
-
getMetadata
Returns the attachment's metadata.
Metadata is stored as a CBOR dictionary and can contain custom key-value pairs associated with the attachment, such as content type, filename, or other properties.
- Returns:
- the metadata dictionary.
-
hashCode
-
equals
-