-
- All Implemented Interfaces:
-
io.getstream.chat.android.client.models.CustomObject
public final class Message implements CustomObject
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMessage.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Message(String id, String cid, String text, String html, String parentId, String command, List<Attachment> attachments, List<String> mentionedUsersIds, List<User> mentionedUsers, Integer replyCount, Map<String, Integer> reactionCounts, Map<String, Integer> reactionScores, SyncStatus syncStatus, String type, List<Reaction> latestReactions, List<Reaction> ownReactions, Date createdAt, Date updatedAt, Date deletedAt, Date updatedLocallyAt, Date createdLocallyAt, User user, Map<String, Object> extraData, Boolean silent, Boolean shadowed, Map<String, String> i18n, Boolean showInChannel, ChannelInfo channelInfo, Message replyTo, String replyMessageId, Boolean pinned, Date pinnedAt, Date pinExpires, User pinnedBy, List<User> threadParticipants)
-
Method Summary
Modifier and Type Method Description final StringgetId()The unique string identifier of the message. final UnitsetId(String id)The unique string identifier of the message. final StringgetCid()Channel unique identifier in <type>:<id> format final UnitsetCid(String cid)Channel unique identifier in <type>:<id> format final StringgetText()The text of this message final UnitsetText(String text)The text of this message final StringgetHtml()The message text formatted as HTML final StringgetParentId()The ID of the parent message, if the message is a thread reply final UnitsetParentId(@SerializedName(value = parent_id) String parentId)The ID of the parent message, if the message is a thread reply final StringgetCommand()Contains provided slash command final UnitsetCommand(String command)Contains provided slash command final List<Attachment>getAttachments()The list of message attachments final UnitsetAttachments(List<Attachment> attachments)The list of message attachments final List<String>getMentionedUsersIds()The list of user mentioned in the message final UnitsetMentionedUsersIds(@SerializedName(value = mentioned_users) List<String> mentionedUsersIds)The list of user mentioned in the message final List<User>getMentionedUsers()The list of user mentioned in the message final UnitsetMentionedUsers(@SerializedName(value = mentioned_users) List<User> mentionedUsers)The list of user mentioned in the message final IntegergetReplyCount()The number of replies to this message final UnitsetReplyCount(@SerializedName(value = reply_count) Integer replyCount)The number of replies to this message final Map<String, Integer>getReactionCounts()A mapping between reaction type and the count, ie like:10, heart:4 final UnitsetReactionCounts(@SerializedName(value = reaction_counts) Map<String, Integer> reactionCounts)A mapping between reaction type and the count, ie like:10, heart:4 final Map<String, Integer>getReactionScores()A mapping between reaction type and the reaction score, ie like:10, heart:4 final UnitsetReactionScores(@SerializedName(value = reaction_scores) Map<String, Integer> reactionScores)A mapping between reaction type and the reaction score, ie like:10, heart:4 final SyncStatusgetSyncStatus()If the message has been synced to the servers, default is synced final UnitsetSyncStatus(SyncStatus syncStatus)If the message has been synced to the servers, default is synced final StringgetType()Contains type of the message. final UnitsetType(String type)Contains type of the message. final List<Reaction>getLatestReactions()List of the latest reactions to this message final UnitsetLatestReactions(@SerializedName(value = latest_reactions) List<Reaction> latestReactions)List of the latest reactions to this message final List<Reaction>getOwnReactions()List of reactions of authenticated user to this message final UnitsetOwnReactions(@SerializedName(value = own_reactions) List<Reaction> ownReactions)List of reactions of authenticated user to this message final DategetCreatedAt()When the message was created final UnitsetCreatedAt(@SerializedName(value = created_at) Date createdAt)When the message was created final DategetUpdatedAt()When the message was updated final UnitsetUpdatedAt(@SerializedName(value = updated_at) Date updatedAt)When the message was updated final DategetDeletedAt()When the message was deleted final UnitsetDeletedAt(@SerializedName(value = deleted_at) Date deletedAt)When the message was deleted final DategetUpdatedLocallyAt()When the message was updated locally final UnitsetUpdatedLocallyAt(Date updatedLocallyAt)When the message was updated locally final DategetCreatedLocallyAt()When the message was created locally final UnitsetCreatedLocallyAt(Date createdLocallyAt)When the message was created locally final UsergetUser()The user who sent the message final UnitsetUser(User user)The user who sent the message Map<String, Object>getExtraData()All the custom data provided for this message UnitsetExtraData(Map<String, Object> extraData)All the custom data provided for this message final BooleangetSilent()Whether message is silent or not final UnitsetSilent(Boolean silent)Whether message is silent or not final BooleangetShadowed()If the message was sent by shadow banned user final UnitsetShadowed(Boolean shadowed)If the message was sent by shadow banned user final Map<String, String>getI18n()Mapping with translations. final BooleangetShowInChannel()Whether thread reply should be shown in the channel as well final UnitsetShowInChannel(@SerializedName(value = show_in_channel) Boolean showInChannel)Whether thread reply should be shown in the channel as well final ChannelInfogetChannelInfo()final UnitsetChannelInfo(@SerializedName(value = channel) ChannelInfo channelInfo)final MessagegetReplyTo()Contains quoted message final UnitsetReplyTo(@SerializedName(value = quoted_message) Message replyTo)Contains quoted message final StringgetReplyMessageId()The ID of the quoted message, if the message is a quoted reply. final UnitsetReplyMessageId(@SerializedName(value = quoted_message_id) String replyMessageId)The ID of the quoted message, if the message is a quoted reply. final BooleangetPinned()Whether message is pinned or not final UnitsetPinned(Boolean pinned)Whether message is pinned or not final DategetPinnedAt()Date when the message got pinned final UnitsetPinnedAt(@SerializedName(value = pinned_at) Date pinnedAt)Date when the message got pinned final DategetPinExpires()Date when pinned message expires final UnitsetPinExpires(@SerializedName(value = pin_expires) Date pinExpires)Date when pinned message expires final UsergetPinnedBy()Contains user who pinned the message final UnitsetPinnedBy(@SerializedName(value = pinned_by) User pinnedBy)Contains user who pinned the message final List<User>getThreadParticipants()The list of users who participate in thread final UnitsetThreadParticipants(@SerializedName(value = thread_participants) List<User> threadParticipants)The list of users who participate in thread -
-
Constructor Detail
-
Message
Message(String id, String cid, String text, String html, String parentId, String command, List<Attachment> attachments, List<String> mentionedUsersIds, List<User> mentionedUsers, Integer replyCount, Map<String, Integer> reactionCounts, Map<String, Integer> reactionScores, SyncStatus syncStatus, String type, List<Reaction> latestReactions, List<Reaction> ownReactions, Date createdAt, Date updatedAt, Date deletedAt, Date updatedLocallyAt, Date createdLocallyAt, User user, Map<String, Object> extraData, Boolean silent, Boolean shadowed, Map<String, String> i18n, Boolean showInChannel, ChannelInfo channelInfo, Message replyTo, String replyMessageId, Boolean pinned, Date pinnedAt, Date pinExpires, User pinnedBy, List<User> threadParticipants)
-
-
Method Detail
-
getId
final String getId()
The unique string identifier of the message. This is either created by Stream or set on the client side when the message is added.
-
setId
final Unit setId(String id)
The unique string identifier of the message. This is either created by Stream or set on the client side when the message is added.
-
getParentId
final String getParentId()
The ID of the parent message, if the message is a thread reply
-
setParentId
final Unit setParentId(@SerializedName(value = parent_id) String parentId)
The ID of the parent message, if the message is a thread reply
-
getCommand
final String getCommand()
Contains provided slash command
-
setCommand
final Unit setCommand(String command)
Contains provided slash command
-
getAttachments
final List<Attachment> getAttachments()
The list of message attachments
-
setAttachments
final Unit setAttachments(List<Attachment> attachments)
The list of message attachments
-
getMentionedUsersIds
final List<String> getMentionedUsersIds()
The list of user mentioned in the message
-
setMentionedUsersIds
final Unit setMentionedUsersIds(@SerializedName(value = mentioned_users) List<String> mentionedUsersIds)
The list of user mentioned in the message
-
getMentionedUsers
final List<User> getMentionedUsers()
The list of user mentioned in the message
-
setMentionedUsers
final Unit setMentionedUsers(@SerializedName(value = mentioned_users) List<User> mentionedUsers)
The list of user mentioned in the message
-
getReplyCount
final Integer getReplyCount()
The number of replies to this message
-
setReplyCount
final Unit setReplyCount(@SerializedName(value = reply_count) Integer replyCount)
The number of replies to this message
-
getReactionCounts
final Map<String, Integer> getReactionCounts()
A mapping between reaction type and the count, ie like:10, heart:4
-
setReactionCounts
final Unit setReactionCounts(@SerializedName(value = reaction_counts) Map<String, Integer> reactionCounts)
A mapping between reaction type and the count, ie like:10, heart:4
-
getReactionScores
final Map<String, Integer> getReactionScores()
A mapping between reaction type and the reaction score, ie like:10, heart:4
-
setReactionScores
final Unit setReactionScores(@SerializedName(value = reaction_scores) Map<String, Integer> reactionScores)
A mapping between reaction type and the reaction score, ie like:10, heart:4
-
getSyncStatus
final SyncStatus getSyncStatus()
If the message has been synced to the servers, default is synced
-
setSyncStatus
final Unit setSyncStatus(SyncStatus syncStatus)
If the message has been synced to the servers, default is synced
-
getType
final String getType()
Contains type of the message. Can be one of the following: regular, ephemeral, error, reply, system, deleted.
-
setType
final Unit setType(String type)
Contains type of the message. Can be one of the following: regular, ephemeral, error, reply, system, deleted.
-
getLatestReactions
final List<Reaction> getLatestReactions()
List of the latest reactions to this message
-
setLatestReactions
final Unit setLatestReactions(@SerializedName(value = latest_reactions) List<Reaction> latestReactions)
List of the latest reactions to this message
-
getOwnReactions
final List<Reaction> getOwnReactions()
List of reactions of authenticated user to this message
-
setOwnReactions
final Unit setOwnReactions(@SerializedName(value = own_reactions) List<Reaction> ownReactions)
List of reactions of authenticated user to this message
-
getCreatedAt
final Date getCreatedAt()
When the message was created
-
setCreatedAt
final Unit setCreatedAt(@SerializedName(value = created_at) Date createdAt)
When the message was created
-
getUpdatedAt
final Date getUpdatedAt()
When the message was updated
-
setUpdatedAt
final Unit setUpdatedAt(@SerializedName(value = updated_at) Date updatedAt)
When the message was updated
-
getDeletedAt
final Date getDeletedAt()
When the message was deleted
-
setDeletedAt
final Unit setDeletedAt(@SerializedName(value = deleted_at) Date deletedAt)
When the message was deleted
-
getUpdatedLocallyAt
final Date getUpdatedLocallyAt()
When the message was updated locally
-
setUpdatedLocallyAt
final Unit setUpdatedLocallyAt(Date updatedLocallyAt)
When the message was updated locally
-
getCreatedLocallyAt
final Date getCreatedLocallyAt()
When the message was created locally
-
setCreatedLocallyAt
final Unit setCreatedLocallyAt(Date createdLocallyAt)
When the message was created locally
-
getExtraData
Map<String, Object> getExtraData()
All the custom data provided for this message
-
setExtraData
Unit setExtraData(Map<String, Object> extraData)
All the custom data provided for this message
-
getShadowed
final Boolean getShadowed()
If the message was sent by shadow banned user
-
setShadowed
final Unit setShadowed(Boolean shadowed)
If the message was sent by shadow banned user
-
getI18n
final Map<String, String> getI18n()
Mapping with translations. Key
languagecontains the original language key. Other keys contain translations.
-
getShowInChannel
final Boolean getShowInChannel()
Whether thread reply should be shown in the channel as well
-
setShowInChannel
final Unit setShowInChannel(@SerializedName(value = show_in_channel) Boolean showInChannel)
Whether thread reply should be shown in the channel as well
-
getChannelInfo
final ChannelInfo getChannelInfo()
-
setChannelInfo
final Unit setChannelInfo(@SerializedName(value = channel) ChannelInfo channelInfo)
-
getReplyTo
final Message getReplyTo()
Contains quoted message
-
setReplyTo
final Unit setReplyTo(@SerializedName(value = quoted_message) Message replyTo)
Contains quoted message
-
getReplyMessageId
final String getReplyMessageId()
The ID of the quoted message, if the message is a quoted reply.
-
setReplyMessageId
final Unit setReplyMessageId(@SerializedName(value = quoted_message_id) String replyMessageId)
The ID of the quoted message, if the message is a quoted reply.
-
getPinnedAt
final Date getPinnedAt()
Date when the message got pinned
-
setPinnedAt
final Unit setPinnedAt(@SerializedName(value = pinned_at) Date pinnedAt)
Date when the message got pinned
-
getPinExpires
final Date getPinExpires()
Date when pinned message expires
-
setPinExpires
final Unit setPinExpires(@SerializedName(value = pin_expires) Date pinExpires)
Date when pinned message expires
-
getPinnedBy
final User getPinnedBy()
Contains user who pinned the message
-
setPinnedBy
final Unit setPinnedBy(@SerializedName(value = pinned_by) User pinnedBy)
Contains user who pinned the message
-
getThreadParticipants
final List<User> getThreadParticipants()
The list of users who participate in thread
-
setThreadParticipants
final Unit setThreadParticipants(@SerializedName(value = thread_participants) List<User> threadParticipants)
The list of users who participate in thread
-
-
-
-