Class Message
- 
                    
                    - All Implemented Interfaces:
 
 public class MessageThe message object that contains and stores the message information received by the client, corresponding to the message in the chat UI. 
- rongcloud 
 
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public enumMessage.MessageDirectionMessage Direction Enumeration.** public enumMessage.SentStatusThe status of the sent message. public classMessage.ReceivedStatusThe status of the received message. It is a bitwise-marked enumeration that supports bitwise operations. 
 - 
                                
                            
                                Field SummaryFields Modifier and Type Field Description public ConversationTypeconversationTypepublic StringtargetIdpublic StringchannelIdpublic intmessageIdpublic Message.MessageDirectionmessageDirectionpublic StringsenderUserIdpublic Message.ReceivedStatusreceivedStatuspublic Message.SentStatussentStatuspublic longreceivedTimepublic longsentTimepublic longreadTimepublic StringobjectNamepublic MessageContentcontentpublic Stringextrapublic ReadReceiptInforeadReceiptInfopublic ReadReceiptInfoV4readReceiptInfoV4public MessageConfigmessageConfigpublic MessagePushConfigmessagePushConfigpublic booleanisOfflinepublic Map<String, String>expansionpublic List<String>directedUserIdspublic booleanisEmptyContentpublic final static Creator<Message>CREATOR
 - 
                                
                            
                                Method SummaryModifier and Type Method Description ConversationTypegetConversationType()Retrieves the conversation type. voidsetConversationType(ConversationType conversationType)Sets the conversation type. StringgetTargetId()Retrieves the target ID. voidsetTargetId(String targetId)Sets the target ID. StringgetChannelId()Get Channel ID voidsetChannelId(String channelId)Sets the channel ID with a maximum length of 20 characters. intgetMessageId()Retrieves the unique value (database index unique value) of the locally stored message. voidsetMessageId(int messageId)Sets the unique value for the locally stored message (database index unique value). Message.MessageDirectiongetMessageDirection()Retrieves the message direction. voidsetMessageDirection(Message.MessageDirection messageDirection)Sets the message direction. StringgetSenderUserId()Retrieves the user ID of the message sender. voidsetSenderUserId(String senderUserId)Sets the user ID of the message sender. Message.ReceivedStatusgetReceivedStatus()Retrieves the receipt status of the message. voidsetReceivedStatus(Message.ReceivedStatus receivedStatus)Sets the received status of the message. Message.SentStatusgetSentStatus()Retrieves the sending status of the message. voidsetSentStatus(Message.SentStatus sentStatus)Sets the sending status of the message. longgetReceivedTime()Gets the message received time (Unix timestamp in milliseconds). voidsetReceivedTime(long receivedTime)Sets the message received time (Unix timestamp in milliseconds). longgetSentTime()Get the message sending time (Unix timestamp, in milliseconds). voidsetSentTime(long sentTime)Sets the message sending time (Unix timestamp in milliseconds). longgetReadTime()voidsetReadTime(long readTime)StringgetObjectName()Gets the name of the message object. voidsetObjectName(String objectName)Sets the name of the message object. MessageContentgetContent()Retrieves the message content. voidsetContent(MessageContent content)Sets the message content. StringgetExtra()Retrieves the additional information of the message. voidsetExtra(String extra)Sets the extra information of the message. ReadReceiptInfogetReadReceiptInfo()Get the read receipt status voidsetReadReceiptInfo(ReadReceiptInfo readReceiptInfo)Sets the read receipt status ReadReceiptInfoV4getReadReceiptInfoV4()Retrieves the Read Receipt V4 information. voidsetReadReceiptInfoV4(ReadReceiptInfoV4 readReceiptInfo)Sets the read receipt V4 information MessageConfiggetMessageConfig()Get Message Configuration voidsetMessageConfig(MessageConfig messageConfig)Set message configuration MessagePushConfiggetMessagePushConfig()Get Push Notification Configuration voidsetMessagePushConfig(MessagePushConfig messagePushConfig)Set push notification configuration booleanisOffline()Indicates whether the message is an offline message. voidsetOffline(boolean offLine)Sets whether the message is an offline message. Map<String, String>getExpansion()List of message extension information List<String>getDirectedUserIds()Get the list of targeted users Returns empty for one-to-one chat conversation type voidsetDirectedUserIds(List<String> directedUserIds)Set the list of targeted users booleanisEmptyContent()static Messageobtain(String targetId, ConversationType type, MessageContent content)Constructor. static Messageobtain(ConversationIdentifier conversationIdentifier, MessageContent content)Constructor. static Messageobtain(String targetId, ConversationType type, String channelId, MessageContent content)Constructor. voidwriteToParcel(Parcel dest, int flags)intdescribeContents()StringgetUId()Get the unique ID of the server message (globally unique under the same AppKey). voidsetUId(String UId)Sets the unique ID for the server message (globally unique within the same AppKey). GroupReadReceiptInfoV2getGroupReadReceiptInfoV2()Get Read Receipt V2 Information voidsetGroupReadReceiptInfoV2(GroupReadReceiptInfoV2 v2)Sets the read receipt V2 information. booleanisCanIncludeExpansion()Indicates whether the message can include extended information. voidsetExpansion(HashMap<String, String> expansion)Set the message extension information list Extension information is only supported for one-to-one chat and group chat. booleanisMayHasMoreMessagesBefore()booleanisHasChanged()Indicates whether the message has been modified. booleanisDisableUpdateLastMessage()inthashCode()booleanequals(Object o)StringtoString()voidsetCanIncludeExpansion(boolean canIncludeExpansion)Sets whether to include extended information. voidsetHasChanged(boolean hasChanged)Sets whether the message has been modified. voidsetDisableUpdateLastMessage(boolean disableUpdateLastMessage)- 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        getConversationTypeConversationType getConversationType() Retrieves the conversation type. - Returns:
- The conversation type. 
 
 - 
                                        setConversationTypevoid setConversationType(ConversationType conversationType) Sets the conversation type. - Parameters:
- conversationType- Specifies the conversation type.
 
 - 
                                        getTargetIdString getTargetId() Retrieves the target ID. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID. - Returns:
- The value of the target ID. 
 
 - 
                                        setTargetIdvoid setTargetId(String targetId) Sets the target ID. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID. - Parameters:
- targetId- The value of the target ID.
 
 - 
                                        getChannelIdString getChannelId() Get Channel ID - Returns:
- Channel ID 
 
 - 
                                        setChannelIdvoid setChannelId(String channelId) Sets the channel ID with a maximum length of 20 characters. - Parameters:
- channelId- The channel ID
 
 - 
                                        getMessageIdint getMessageId() Retrieves the unique value (database index unique value) of the locally stored message. - Returns:
- The unique value (database index unique value) of the locally stored message. 
 
 - 
                                        setMessageIdvoid setMessageId(int messageId) Sets the unique value for the locally stored message (database index unique value). - Parameters:
- messageId- The unique value for the locally stored message (database index unique value).
 
 - 
                                        getMessageDirectionMessage.MessageDirection getMessageDirection() Retrieves the message direction. - Returns:
- The direction of the message. 
 
 - 
                                        setMessageDirectionvoid setMessageDirection(Message.MessageDirection messageDirection) Sets the message direction. - Parameters:
- messageDirection- Specifies the message direction.
 
 - 
                                        getSenderUserIdString getSenderUserId() Retrieves the user ID of the message sender. - Returns:
- The user ID of the message sender. 
 
 - 
                                        setSenderUserIdvoid setSenderUserId(String senderUserId) Sets the user ID of the message sender. - Parameters:
- senderUserId- The user ID of the message sender.
 
 - 
                                        getReceivedStatusMessage.ReceivedStatus getReceivedStatus() Retrieves the receipt status of the message. - Returns:
- The receipt status of the message. 
 
 - 
                                        setReceivedStatusvoid setReceivedStatus(Message.ReceivedStatus receivedStatus) Sets the received status of the message. - Parameters:
- receivedStatus- Indicates the received status of the message.
 
 - 
                                        getSentStatusMessage.SentStatus getSentStatus() Retrieves the sending status of the message. - Returns:
- The sending status of the message. 
 
 - 
                                        setSentStatusvoid setSentStatus(Message.SentStatus sentStatus) Sets the sending status of the message. - Parameters:
- sentStatus- The sending status of the message.
 
 - 
                                        getReceivedTimelong getReceivedTime() Gets the message received time (Unix timestamp in milliseconds). The received time is the local time of the client when the message arrives at the receiving client. - Returns:
- The message received time (Unix timestamp in milliseconds). 
 
 - 
                                        setReceivedTimevoid setReceivedTime(long receivedTime) Sets the message received time (Unix timestamp in milliseconds). The received time is the local time of the client when the message arrives at the receiving client. - Parameters:
- receivedTime- The message received time (Unix timestamp in milliseconds).
 
 - 
                                        getSentTimelong getSentTime() Get the message sending time (Unix timestamp, in milliseconds). The sending time is the server time when the message arrives at the server from the sending client. - Returns:
- The message sending time (Unix timestamp, in milliseconds). 
 
 - 
                                        setSentTimevoid setSentTime(long sentTime) Sets the message sending time (Unix timestamp in milliseconds). The sending time is the server time when the message arrives at the server from the sending client. - Parameters:
- sentTime- The message sending time (Unix timestamp in milliseconds).
 
 - 
                                        getReadTimelong getReadTime() 
 - 
                                        setReadTimevoid setReadTime(long readTime) 
 - 
                                        getObjectNameString getObjectName() Gets the name of the message object. The name of the message object corresponds to the value specified in the annotation. - Returns:
- The name of the message object. 
 
 - 
                                        setObjectNamevoid setObjectName(String objectName) Sets the name of the message object. The message object name corresponds to the value specified in the annotation. - Parameters:
- objectName- The name of the message object.
 
 - 
                                        getContentMessageContent getContent() Retrieves the message content. - Returns:
- The message content. 
 
 - 
                                        setContentvoid setContent(MessageContent content) Sets the message content. - Parameters:
- content- The content of the message.
 
 - 
                                        getExtraString getExtra() Retrieves the additional information of the message. - Returns:
- The additional information of the message. 
 
 - 
                                        setExtravoid setExtra(String extra) Sets the extra information of the message. - Parameters:
- extra- The extra information of the message.
 
 - 
                                        getReadReceiptInfoReadReceiptInfo getReadReceiptInfo() Get the read receipt status - Returns:
- The read receipt status 
 
 - 
                                        setReadReceiptInfovoid setReadReceiptInfo(ReadReceiptInfo readReceiptInfo) Sets the read receipt status - Parameters:
- readReceiptInfo- The read receipt status
 
 - 
                                        getReadReceiptInfoV4ReadReceiptInfoV4 getReadReceiptInfoV4() Retrieves the Read Receipt V4 information. - Returns:
- The Read Receipt V4 information 
 
 - 
                                        setReadReceiptInfoV4void setReadReceiptInfoV4(ReadReceiptInfoV4 readReceiptInfo) Sets the read receipt V4 information - Parameters:
- readReceiptInfo- The read receipt V4 information
 
 - 
                                        getMessageConfigMessageConfig getMessageConfig() Get Message Configuration - Returns:
- MessageConfig Specifies the message configuration 
 
 - 
                                        setMessageConfigvoid setMessageConfig(MessageConfig messageConfig) Set message configuration - Parameters:
- messageConfig- Message configuration
 
 - 
                                        getMessagePushConfigMessagePushConfig getMessagePushConfig() Get Push Notification Configuration - Returns:
- MessagePushConfig Push notification configuration 
 
 - 
                                        setMessagePushConfigvoid setMessagePushConfig(MessagePushConfig messagePushConfig) Set push notification configuration - Parameters:
- messagePushConfig- Push notification configuration
 
 - 
                                        isOfflineboolean isOffline() Indicates whether the message is an offline message. This field is invalid for messages retrieved from the database. Only valid in the message received callback method. YES if the message is an offline message. NO in all other cases.
 - 
                                        setOfflinevoid setOffline(boolean offLine) Sets whether the message is an offline message. - Parameters:
- offLine- Indicates whether the message is an offline message.
 
 - 
                                        getExpansionMap<String, String> getExpansion() List of message extension information - Returns:
- List of message extension information 
 
 - 
                                        getDirectedUserIdsList<String> getDirectedUserIds() Get the list of targeted users Returns empty for one-to-one chat conversation type - Returns:
- The list of targeted users 
- Since:
- 5.8.0 
 
 - 
                                        setDirectedUserIdsvoid setDirectedUserIds(List<String> directedUserIds) Set the list of targeted users - Parameters:
- directedUserIds- List of targeted users
- Since:
- 5.8.0 
 
 - 
                                        isEmptyContentboolean isEmptyContent() 
 - 
                                        obtainstatic Message obtain(String targetId, ConversationType type, MessageContent content) Constructor. - Parameters:
- targetId- Conversation ID
- type- Conversation type
- content- Message content
- Returns:
- Message object 
 
 - 
                                        obtainstatic Message obtain(ConversationIdentifier conversationIdentifier, MessageContent content) Constructor. - Parameters:
- conversationIdentifier- Conversation identifier
- content- Message content
- Returns:
- Message object 
 
 - 
                                        obtainstatic Message obtain(String targetId, ConversationType type, String channelId, MessageContent content) Constructor. - Parameters:
- targetId- Conversation ID
- type- Conversation type
- channelId- Conversation channel ID
- content- Message content
- Returns:
- Message object 
 
 - 
                                        writeToParcelvoid writeToParcel(Parcel dest, int flags) 
 - 
                                        describeContentsint describeContents() 
 - 
                                        getUIdString getUId() Get the unique ID of the server message (globally unique under the same AppKey). - Returns:
- uid The unique ID of the server message (globally unique under the same AppKey). 
 
 - 
                                        setUIdvoid setUId(String UId) Sets the unique ID for the server message (globally unique within the same AppKey). - Parameters:
- UId- The unique ID for the server message (globally unique within the same AppKey)
 
 - 
                                        getGroupReadReceiptInfoV2GroupReadReceiptInfoV2 getGroupReadReceiptInfoV2() Get Read Receipt V2 Information - Returns:
- Read Receipt V2 Information 
 
 - 
                                        setGroupReadReceiptInfoV2void setGroupReadReceiptInfoV2(GroupReadReceiptInfoV2 v2) Sets the read receipt V2 information. - Parameters:
- v2- The read receipt V2 information
 
 - 
                                        isCanIncludeExpansionboolean isCanIncludeExpansion() Indicates whether the message can include extended information. This property is determined when the message is sent and cannot be modified afterward. Extended information is only supported in one-to-one and group chats; other conversation types cannot set extended information. - Returns:
- Indicates whether the message can include extended information. 
 
 - 
                                        setExpansionvoid setExpansion(HashMap<String, String> expansion) Set the message extension information list Extension information is only supported for one-to-one chat and group chat. Other conversation types cannot set extension information. By default, the message extension dictionary key length cannot exceed 32, and the value length cannot exceed 4096. The maximum number of extensions that can be set at once is 20, and the total number of extensions for a message cannot exceed 300. - Parameters:
- expansion- The message extension information list
 
 - 
                                        isMayHasMoreMessagesBeforeboolean isMayHasMoreMessagesBefore() 
 - 
                                        isHasChangedboolean isHasChanged() Indicates whether the message has been modified. - Returns:
- Specifies whether the message has been modified. 
 
 - 
                                        isDisableUpdateLastMessageboolean isDisableUpdateLastMessage() 
 - 
                                        hashCodeint hashCode() 
 - 
                                        equalsboolean equals(Object o) 
 - 
                                        toStringString toString() 
 - 
                                        setCanIncludeExpansionvoid setCanIncludeExpansion(boolean canIncludeExpansion) Sets whether to include extended information. - Parameters:
- canIncludeExpansion- Indicates whether to include extended information.
 
 - 
                                        setHasChangedvoid setHasChanged(boolean hasChanged) Sets whether the message has been modified. - Parameters:
- hasChanged- Indicates whether the message has been modified.
 
 - 
                                        setDisableUpdateLastMessagevoid setDisableUpdateLastMessage(boolean disableUpdateLastMessage) 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-