Class MessageContent
- 
                    
                    - All Implemented Interfaces:
 
 public abstract class MessageContentThe base class for messages. Defines methods for converting between message objects and message data. 
- 
                
                    
                    - 
                                
                            
                                Field SummaryFields Modifier and Type Field Description public UserInfouserInfopublic MentionedInfomentionedInfopublic booleanisDestructpublic longdestructTimepublic MessageAuditInfoauditInfopublic Array<byte>rawJsonData
 - 
                                
                            
                                Constructor SummaryConstructors Constructor Description MessageContent(Array<byte> data)Deserializes message data into a local message object. 
 - 
                                
                            
                                Method SummaryModifier and Type Method Description UserInfogetUserInfo()Get user information voidsetUserInfo(UserInfo info)Set user information MentionedInfogetMentionedInfo()Get @user information voidsetMentionedInfo(MentionedInfo info)Set @ user information booleanisDestruct()Indicates whether the message is set to auto-destroy after a certain time. voidsetDestruct(boolean destruct)Sets whether the message is timed-destruct. longgetDestructTime()Retrieves the auto-destroy time. voidsetDestructTime(long destructTime)Sets the self-destruct timer. MessageAuditInfogetAuditInfo()Retrieves the message moderation configuration voidsetAuditInfo(MessageAuditInfo auditInfo)Set message moderation configuration Array<byte>getRawJsonData()Retrieves the raw binary data of the message. voidsetRawJsonData(Array<byte> rawJsonData)Sets the raw binary data of the message. abstract Array<byte>encode()Serializes the local message object into message data. JSONObjectgetBaseJsonObject()Converts the self-destruct field, @ mention field, user info field, and extra field of the base class into a JSONObject. voidparseBaseJsonObject(JSONObject jsonObject)Parses the self-destruct field, @ mention field, user information field, and extra field from the JSONObject into the message body. voidwriteToBaseInfoParcel(Parcel dest)Writes the data of the base class's self-destruct field, @ mention field, user information field, and extra field into the externally provided Parcel. voidreadFromBaseInfoParcel(Parcel in)JSONObjectgetJSONDestructInfo()voidparseJsonToDestructInfo(JSONObject jsonObject)JSONObjectgetJSONUserInfo()UserInfoparseJsonToUserInfo(JSONObject jsonObj)Parses the user JSON object List<String>getSearchableWord()Returns the searchable content within the message body. StringgetExtra()Get message extension information voidsetExtra(String extra)Sets the message extended information - 
                    
                    
                    - 
                                
                            
                                Constructor Detail- 
                                        MessageContentMessageContent(Array<byte> data) Deserializes message data into a local message object.- Parameters:
- data- The message data.
 
 
- 
                                        
 - 
                                
                            
                                Method Detail- 
                                        getUserInfoUserInfo getUserInfo() Get user information - Returns:
- User information 
 
 - 
                                        setUserInfovoid setUserInfo(UserInfo info) Set user information - Parameters:
- info- User information
 
 - 
                                        getMentionedInfoMentionedInfo getMentionedInfo() Get @user information - Returns:
- @user information
 
 - 
                                        setMentionedInfovoid setMentionedInfo(MentionedInfo info) Set @ user information - Parameters:
- info-- @ user information
 
 - 
                                        isDestructboolean isDestruct() Indicates whether the message is set to auto-destroy after a certain time. - Returns:
- Indicates whether the message is set to auto-destroy after a certain time. 
 
 - 
                                        setDestructvoid setDestruct(boolean destruct) Sets whether the message is timed-destruct. - Parameters:
- destruct- Indicates whether the message is timed-destruct.
 
 - 
                                        getDestructTimelong getDestructTime() Retrieves the auto-destroy time. If isDestruct is false, the message will be destroyed after the specified destructTime once it is marked as read. - Returns:
- The auto-destroy time. If isDestruct is false, the message will be destroyed after the specified destructTime once it is marked as read. 
 
 - 
                                        setDestructTimevoid setDestructTime(long destructTime) Sets the self-destruct timer. If isDestruct is false, the message will be destroyed after the specified destructTime elapses once it is marked as read. - Parameters:
- destructTime- Specifies the self-destruct timer.
 
 - 
                                        getAuditInfoMessageAuditInfo getAuditInfo() Retrieves the message moderation configuration - Returns:
- The message moderation configuration 
 
 - 
                                        setAuditInfovoid setAuditInfo(MessageAuditInfo auditInfo) Set message moderation configuration - Parameters:
- auditInfo- Message moderation configuration
 
 - 
                                        getRawJsonDataArray<byte> getRawJsonData() Retrieves the raw binary data of the message. This method is only valid in the IPC process and not in the main process. - Returns:
- Binary data 
 
 - 
                                        setRawJsonDatavoid setRawJsonData(Array<byte> rawJsonData) Sets the raw binary data of the message. This is only valid in the IPC process and has no effect in the main process. - Parameters:
- rawJsonData- The binary data
 
 - 
                                        encodeabstract Array<byte> encode() Serializes the local message object into message data. - Returns:
- The message data. 
 
 - 
                                        getBaseJsonObjectJSONObject getBaseJsonObject() Converts the self-destruct field, @ mention field, user info field, and extra field of the base class into a JSONObject. - Returns:
- A JSONObject containing the above fields. 
 
 - 
                                        parseBaseJsonObjectvoid parseBaseJsonObject(JSONObject jsonObject) Parses the self-destruct field, @ mention field, user information field, and extra field from the JSONObject into the message body. - Parameters:
- jsonObject- The JSONObject containing the above fields.
 
 - 
                                        writeToBaseInfoParcelvoid writeToBaseInfoParcel(Parcel dest) Writes the data of the base class's self-destruct field, @ mention field, user information field, and extra field into the externally provided Parcel. - Parameters:
- dest- The Parcel into which the object is written.
 
 - 
                                        readFromBaseInfoParcelvoid readFromBaseInfoParcel(Parcel in) - Parameters:
- in- The Parcel passed to initialize the self-destruct field, @mention field, user information field, and extra field in the base class.
 
 - 
                                        getJSONDestructInfoJSONObject getJSONDestructInfo() 
 - 
                                        parseJsonToDestructInfovoid parseJsonToDestructInfo(JSONObject jsonObject) 
 - 
                                        getJSONUserInfoJSONObject getJSONUserInfo() 
 - 
                                        parseJsonToUserInfoUserInfo parseJsonToUserInfo(JSONObject jsonObj) Parses the user JSON object - Parameters:
- jsonObj- The JSON object of the user
 
 - 
                                        getSearchableWordList<String> getSearchableWord() Returns the searchable content within the message body. If developers want to enable custom message content to be searchable, they need to implement this method and return the searchable content. - Returns:
- The searchable content; if the message contains multiple fields, each field can be populated into a List; for example, the title and summary of a graphic message. 
 
 - 
                                        getExtraString getExtra() Get message extension information - Returns:
- Extended Information 
 
 - 
                                        setExtravoid setExtra(String extra) Sets the message extended information - Parameters:
- extra- Extended Information
 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-