Interface AttachmentProvider

All Known Implementing Classes:
AudioMessage, DocumentMessage, ExternalBlobReference, HistorySyncNotification, ImageMessage, MediaMessage, PaymentInvoiceMessage, StickerMessage, VideoMessage

public sealed interface AttachmentProvider permits MediaMessage, ExternalBlobReference, HistorySyncNotification
A sealed interface that represents a class that can provide data about a media
  • Method Details

    • mediaUrl

      String mediaUrl()
      Returns the url to the media
      Returns:
      a nullable String
    • mediaUrl

      AttachmentProvider mediaUrl(String mediaUrl)
      Sets the media url of this provider
      Returns:
      the same provider
    • mediaDirectPath

      String mediaDirectPath()
      Returns the direct path to the media
      Returns:
      a nullable String
    • mediaDirectPath

      AttachmentProvider mediaDirectPath(String mediaDirectPath)
      Sets the direct path of this provider
      Returns:
      the same provider
    • mediaKey

      byte[] mediaKey()
      Returns the key of this media
      Returns:
      a non-null array of bytes
    • mediaKey

      AttachmentProvider mediaKey(byte[] bytes)
      Sets the media key of this provider
      Returns:
      the same provider
    • mediaSha256

      byte[] mediaSha256()
      Returns the sha256 of this media
      Returns:
      a non-null array of bytes
    • mediaSha256

      AttachmentProvider mediaSha256(byte[] bytes)
      Sets the sha256 of the media in this provider
      Returns:
      the same provider
    • mediaEncryptedSha256

      byte[] mediaEncryptedSha256()
      Returns the sha256 of this encrypted media
      Returns:
      a non-null array of bytes
    • mediaEncryptedSha256

      AttachmentProvider mediaEncryptedSha256(byte[] bytes)
      Sets the sha256 of the encrypted media in this provider
      Returns:
      the same provider
    • mediaSize

      long mediaSize()
      Returns the size of this media
      Returns:
      a long
    • mediaSize

      AttachmentProvider mediaSize(long mediaSize)
      Sets the size of this media
      Returns:
      a long
    • mediaName

      String mediaName()
      Returns the name of this media for Whatsapp
      Returns:
      a non-null String