java.lang.Object
it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<ImageMessage>
it.auties.whatsapp.model.message.standard.ImageMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,InteractiveHeaderAttachment,HighlyStructuredFourRowTemplateTitle,HydratedFourRowTemplateTitle,MutableAttachmentProvider<ImageMessage>,ButtonsMessageHeader,ContextualMessage,MediaMessage<ImageMessage>,Message
public final class ImageMessage
extends it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<ImageMessage>
implements MediaMessage<ImageMessage>, InteractiveHeaderAttachment, ButtonsMessageHeader, HighlyStructuredFourRowTemplateTitle, HydratedFourRowTemplateTitle
A model class that represents a message holding an image 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 ContextInfoprivate final Integerprivate final Integerprivate final byte[]private final Integerprivate final List<InteractiveLocationAnnotation> private Stringprivate byte[]private byte[]private Longprivate byte[]private Longprivate Stringprivate final byte[]private final byte[]private final Stringprivate final byte[]private final Stringprivate final byte[]private final Stringprivate final byte[]private final byte[]private final booleanprivate final Integer -
Constructor Summary
ConstructorsConstructorDescriptionImageMessage(String mediaUrl, String mimetype, String caption, byte[] mediaSha256, Long mediaSize, Integer height, Integer width, byte[] mediaKey, byte[] mediaEncryptedSha256, List<InteractiveLocationAnnotation> interactiveAnnotations, String mediaDirectPath, Long mediaKeyTimestampSeconds, byte[] thumbnail, ContextInfo contextInfo, byte[] firstScanSidecar, Integer firstScanLength, Integer experimentGroupId, byte[] scansSidecar, List<Integer> scanLengths, byte[] midQualityFileSha256, byte[] midQualityFileEncSha256, boolean viewOnce, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, String staticUrl) -
Method Summary
Modifier and TypeMethodDescriptioncaption()Optional<byte[]> height()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 mediaOptional<byte[]> Optional<byte[]> mimetype()Optional<byte[]> 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 provider(package private) static ImageMessagesimpleBuilder(byte[] media, String mimeType, String caption, byte[] thumbnail, ContextInfo contextInfo) Constructs a new builder to create a ImageMessage.Optional<byte[]> Optional<byte[]> Optional<byte[]> Return the type of this titlebooleanviewOnce()width()Methods 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
attachmentType, category, type
-
Field Details
-
mediaUrl
-
mimetype
-
caption
-
mediaSha256
private byte[] mediaSha256 -
mediaSize
-
height
-
width
-
mediaKey
private byte[] mediaKey -
mediaEncryptedSha256
private byte[] mediaEncryptedSha256 -
interactiveAnnotations
-
mediaDirectPath
-
mediaKeyTimestampSeconds
-
thumbnail
private final byte[] thumbnail -
contextInfo
-
firstScanSidecar
private final byte[] firstScanSidecar -
firstScanLength
-
experimentGroupId
-
scansSidecar
private final byte[] scansSidecar -
scanLengths
-
midQualityFileSha256
private final byte[] midQualityFileSha256 -
midQualityFileEncSha256
private final byte[] midQualityFileEncSha256 -
viewOnce
private final boolean viewOnce -
thumbnailDirectPath
-
thumbnailSha256
private final byte[] thumbnailSha256 -
thumbnailEncSha256
private final byte[] thumbnailEncSha256 -
staticUrl
-
-
Constructor Details
-
ImageMessage
public ImageMessage(String mediaUrl, String mimetype, String caption, byte[] mediaSha256, Long mediaSize, Integer height, Integer width, byte[] mediaKey, byte[] mediaEncryptedSha256, List<InteractiveLocationAnnotation> interactiveAnnotations, String mediaDirectPath, Long mediaKeyTimestampSeconds, byte[] thumbnail, ContextInfo contextInfo, byte[] firstScanSidecar, Integer firstScanLength, Integer experimentGroupId, byte[] scansSidecar, List<Integer> scanLengths, byte[] midQualityFileSha256, byte[] midQualityFileEncSha256, boolean viewOnce, String thumbnailDirectPath, byte[] thumbnailSha256, byte[] thumbnailEncSha256, String staticUrl)
-
-
Method Details
-
simpleBuilder
static ImageMessage simpleBuilder(byte[] media, String mimeType, String caption, byte[] thumbnail, ContextInfo contextInfo) Constructs a new builder to create a ImageMessage. The newsletters can be later sent usingWhatsapp.sendMessage(ChatMessageInfo)- Parameters:
media- the non-null image that the new message wrapsmimeType- the mime type of the new message, by defaultMediaMessageType.defaultMimeType()caption- the caption of the new messagethumbnail- the thumbnail of the document that the new message wrapscontextInfo- the context info that the new message wraps- Returns:
- a non-null new message
-
mediaUrl
Description copied from interface:MutableAttachmentProviderReturns the url to the media- Specified by:
mediaUrlin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- a nullable String
-
setMediaUrl
Description copied from interface:MutableAttachmentProviderSets the media url of this provider- Specified by:
setMediaUrlin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- the same provider
-
mediaDirectPath
Description copied from interface:MutableAttachmentProviderReturns the direct path to the media- Specified by:
mediaDirectPathin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- a nullable String
-
setMediaDirectPath
Description copied from interface:MutableAttachmentProviderSets the direct path of this provider- Specified by:
setMediaDirectPathin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- the same provider
-
mediaKey
Description copied from interface:MutableAttachmentProviderReturns the key of this media- Specified by:
mediaKeyin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- a non-null array of bytes
-
setMediaKey
Description copied from interface:MutableAttachmentProviderSets the media key of this provider- Specified by:
setMediaKeyin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- the same provider
-
setMediaKeyTimestamp
Description copied from interface:MutableAttachmentProviderSets the timestamp of the media key- Specified by:
setMediaKeyTimestampin interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- the same provider
-
mediaSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this media- Specified by:
mediaSha256in interfaceMutableAttachmentProvider<ImageMessage>- 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<ImageMessage>- Returns:
- the same provider
-
mediaEncryptedSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this encrypted media- Specified by:
mediaEncryptedSha256in interfaceMutableAttachmentProvider<ImageMessage>- 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<ImageMessage>- Returns:
- the same provider
-
mediaSize
Description copied from interface:MutableAttachmentProviderReturns the size of this media- Specified by:
mediaSizein interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- a long
-
mediaKeyTimestampSeconds
Description copied from interface:MediaMessageReturns the timestampSeconds, that is the seconds elapsed sinceInstant.EPOCH, forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampSecondsin interfaceMediaMessage<ImageMessage>- Returns:
- an unsigned long
-
mediaKeyTimestamp
Description copied from interface:MediaMessageReturns the timestampSeconds forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampin interfaceMediaMessage<ImageMessage>- Returns:
- a zoned date time
-
setMediaSize
Description copied from interface:MutableAttachmentProviderSets the size of this media- Specified by:
setMediaSizein interfaceMutableAttachmentProvider<ImageMessage>- Returns:
- a long
-
contextInfo
- Specified by:
contextInfoin interfaceContextualMessage
-
mediaType
Description copied from interface:MediaMessageReturns the media type of the media that this object wraps- Specified by:
mediaTypein interfaceMediaMessage<ImageMessage>- Returns:
- a non-null
MediaMessageType
-
titleType
Description copied from interface:HighlyStructuredFourRowTemplateTitleReturn the type of this title- Specified by:
titleTypein interfaceHighlyStructuredFourRowTemplateTitle- Returns:
- a non-null type
-
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
-
buttonHeaderType
- Specified by:
buttonHeaderTypein interfaceButtonsMessageHeader
-
mimetype
-
caption
-
height
-
width
-
interactiveAnnotations
-
thumbnail
-
firstScanSidecar
-
firstScanLength
-
experimentGroupId
-
scansSidecar
-
scanLengths
-
midQualityFileSha256
-
midQualityFileEncSha256
-
viewOnce
public boolean viewOnce() -
thumbnailDirectPath
-
thumbnailSha256
-
thumbnailEncSha256
-
staticUrl
-