java.lang.Object
it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<DocumentMessage>
it.auties.whatsapp.model.message.standard.DocumentMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,InteractiveHeaderAttachment,HighlyStructuredFourRowTemplateTitle,HydratedFourRowTemplateTitle,MutableAttachmentProvider<DocumentMessage>,ButtonsMessageHeader,ContextualMessage<DocumentMessage>,MediaMessage<DocumentMessage>,Message
public final class DocumentMessage
extends it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<DocumentMessage>
implements MediaMessage<DocumentMessage>, InteractiveHeaderAttachment, ButtonsMessageHeader, HighlyStructuredFourRowTemplateTitle, HydratedFourRowTemplateTitle
A model class that represents a message holding a document inside
-
Nested Class Summary
Nested classes/interfaces inherited from interface it.auties.whatsapp.model.message.button.ButtonsMessageHeader
ButtonsMessageHeader.TypeNested classes/interfaces inherited from interface it.auties.whatsapp.model.button.template.hsm.HighlyStructuredFourRowTemplateTitle
HighlyStructuredFourRowTemplateTitle.TypeNested classes/interfaces inherited from interface it.auties.whatsapp.model.button.template.hydrated.HydratedFourRowTemplateTitle
HydratedFourRowTemplateTitle.TypeNested classes/interfaces inherited from interface it.auties.whatsapp.model.button.interactive.InteractiveHeaderAttachment
InteractiveHeaderAttachment.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final booleanprivate ContextInfoprivate final Stringprivate Stringprivate byte[]private byte[]private Longprivate byte[]private Longprivate Stringprivate final Stringprivate final Integerprivate final byte[]private final Stringprivate final byte[]private final Integerprivate final byte[]private final Integerprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionDocumentMessage(String mediaUrl, String mimetype, String title, byte[] mediaSha256, Long mediaSize, Integer pageCount, byte[] mediaKey, String fileName, byte[] mediaEncryptedSha256, String mediaDirectPath, Long mediaKeyTimestampSeconds, byte[] thumbnail, boolean contactVcard, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, ContextInfo contextInfo, Integer thumbnailHeight, Integer thumbnailWidth, String caption) -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of this attachmentcaption()boolean(package private) static DocumentMessagecustomBuilder(byte[] media, String fileName, String mimeType, String title, int pageCount, byte[] thumbnail, ContextInfo contextInfo) fileName()private static StringgetMimeType(byte[] media, String fileName, String mimeType) Return the type of this titleReturns the direct path to the mediaOptional<byte[]> Returns the sha256 of this encrypted mediaOptional<byte[]> mediaKey()Returns the key of this mediaReturns the timestampSeconds forMutableAttachmentProvider.mediaKey()Returns the timestampSeconds, that is the seconds elapsed sinceInstant.EPOCH, forMutableAttachmentProvider.mediaKey()Optional<byte[]> Returns the sha256 of this mediaReturns the size of this mediaReturns the media type of the media that this object wrapsmediaUrl()Returns the url to the mediamimetype()setContextInfo(ContextInfo contextInfo) setMediaDirectPath(String mediaDirectPath) Sets the direct path of this providersetMediaEncryptedSha256(byte[] bytes) Sets the sha256 of the encrypted media in this providersetMediaKey(byte[] bytes) Sets the media key of this providersetMediaKeyTimestamp(Long timestamp) Sets the timestamp of the media keysetMediaSha256(byte[] bytes) Sets the sha256 of the media in this providersetMediaSize(long mediaSize) Sets the size of this mediasetMediaUrl(String mediaUrl) Sets the media url of this providerOptional<byte[]> Optional<byte[]> Optional<byte[]> title()Return the type of this titleMethods inherited from class it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage
decodedMedia, handle, setDecodedMedia, setHandleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.auties.whatsapp.model.message.model.MediaMessage
category, type
-
Field Details
-
mediaUrl
-
mimetype
-
title
-
mediaSha256
private byte[] mediaSha256 -
mediaSize
-
pageCount
-
mediaKey
private byte[] mediaKey -
fileName
-
mediaEncryptedSha256
private byte[] mediaEncryptedSha256 -
mediaDirectPath
-
mediaKeyTimestampSeconds
-
thumbnail
private final byte[] thumbnail -
contactVcard
private final boolean contactVcard -
thumbnailDirectPath
-
thumbnailSha256
private final byte[] thumbnailSha256 -
thumbnailEncSha256
private final byte[] thumbnailEncSha256 -
contextInfo
-
thumbnailHeight
-
thumbnailWidth
-
caption
-
-
Constructor Details
-
DocumentMessage
public DocumentMessage(String mediaUrl, String mimetype, String title, byte[] mediaSha256, Long mediaSize, Integer pageCount, byte[] mediaKey, String fileName, byte[] mediaEncryptedSha256, String mediaDirectPath, Long mediaKeyTimestampSeconds, byte[] thumbnail, boolean contactVcard, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, ContextInfo contextInfo, Integer thumbnailHeight, Integer thumbnailWidth, String caption)
-
-
Method Details
-
customBuilder
static DocumentMessage customBuilder(byte[] media, String fileName, String mimeType, String title, int pageCount, byte[] thumbnail, ContextInfo contextInfo) -
getMimeType
-
pageCount
-
title
-
fileName
-
contactVcard
public boolean contactVcard() -
caption
-
mediaUrl
Description copied from interface:MutableAttachmentProviderReturns the url to the media- Specified by:
mediaUrlin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a nullable String
-
setMediaUrl
Description copied from interface:MutableAttachmentProviderSets the media url of this provider- Specified by:
setMediaUrlin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
mediaDirectPath
Description copied from interface:MutableAttachmentProviderReturns the direct path to the media- Specified by:
mediaDirectPathin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a nullable String
-
setMediaDirectPath
Description copied from interface:MutableAttachmentProviderSets the direct path of this provider- Specified by:
setMediaDirectPathin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
mediaKey
Description copied from interface:MutableAttachmentProviderReturns the key of this media- Specified by:
mediaKeyin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a non-null array of bytes
-
setMediaKey
Description copied from interface:MutableAttachmentProviderSets the media key of this provider- Specified by:
setMediaKeyin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
setMediaKeyTimestamp
Description copied from interface:MutableAttachmentProviderSets the timestamp of the media key- Specified by:
setMediaKeyTimestampin interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
mediaSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this media- Specified by:
mediaSha256in interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a non-null array of bytes
-
setMediaSha256
Description copied from interface:MutableAttachmentProviderSets the sha256 of the media in this provider- Specified by:
setMediaSha256in interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
mediaEncryptedSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this encrypted media- Specified by:
mediaEncryptedSha256in interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a non-null array of bytes
-
setMediaEncryptedSha256
Description copied from interface:MutableAttachmentProviderSets the sha256 of the encrypted media in this provider- Specified by:
setMediaEncryptedSha256in interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- the same provider
-
mediaSize
Description copied from interface:MutableAttachmentProviderReturns the size of this media- Specified by:
mediaSizein interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a long
-
mediaKeyTimestampSeconds
Description copied from interface:MediaMessageReturns the timestampSeconds, that is the seconds elapsed sinceInstant.EPOCH, forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampSecondsin interfaceMediaMessage<DocumentMessage>- Returns:
- an unsigned long
-
mediaKeyTimestamp
Description copied from interface:MediaMessageReturns the timestampSeconds forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampin interfaceMediaMessage<DocumentMessage>- Returns:
- a zoned date time
-
setMediaSize
Description copied from interface:MutableAttachmentProviderSets the size of this media- Specified by:
setMediaSizein interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a long
-
contextInfo
- Specified by:
contextInfoin interfaceContextualMessage<DocumentMessage>
-
mediaType
Description copied from interface:MediaMessageReturns the media type of the media that this object wraps- Specified by:
mediaTypein interfaceMediaMessage<DocumentMessage>- Returns:
- a non-null
MediaMessageType
-
attachmentType
Description copied from interface:MutableAttachmentProviderReturns the type of this attachment- Specified by:
attachmentTypein interfaceMediaMessage<DocumentMessage>- Specified by:
attachmentTypein interfaceMutableAttachmentProvider<DocumentMessage>- Returns:
- a non-null attachment
-
titleType
Description copied from interface:HighlyStructuredFourRowTemplateTitleReturn the type of this title- Specified by:
titleTypein interfaceHighlyStructuredFourRowTemplateTitle- Returns:
- a non-null type
-
buttonHeaderType
- Specified by:
buttonHeaderTypein interfaceButtonsMessageHeader
-
hydratedTitleType
Description copied from interface:HydratedFourRowTemplateTitleReturn the type of this title- Specified by:
hydratedTitleTypein interfaceHydratedFourRowTemplateTitle- Returns:
- a non-null type
-
interactiveHeaderType
- Specified by:
interactiveHeaderTypein interfaceInteractiveHeaderAttachment
-
mimetype
-
thumbnail
-
thumbnailDirectPath
-
thumbnailSha256
-
thumbnailEncSha256
-
thumbnailHeight
-
thumbnailWidth
-
setContextInfo
- Specified by:
setContextInfoin interfaceContextualMessage<DocumentMessage>
-