public class LCIMMessage extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LCIMMessage.MessageIOType |
static class |
LCIMMessage.MessageStatus |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bytes |
protected String |
content |
protected String |
conversationId |
protected String |
currentClient |
protected long |
deliveredAt |
protected String |
from |
protected LCIMMessage.MessageIOType |
ioType |
protected boolean |
mentionAll |
protected List<String> |
mentionList |
protected String |
messageId |
protected long |
readAt |
protected LCIMMessage.MessageStatus |
status |
protected long |
timestamp |
protected String |
uniqueToken |
protected long |
updateAt |
Constructor and Description |
---|
LCIMMessage() |
LCIMMessage(String conversationId,
String from) |
LCIMMessage(String conversationId,
String from,
long timestamp,
long deliveredAt) |
LCIMMessage(String conversationId,
String from,
long timestamp,
long deliveredAt,
long readAt) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
dumpRawData() |
boolean |
equals(Object other) |
protected void |
generateUniqueToken() |
String |
getContent()
获取消息体的内容
|
String |
getConversationId()
获取当前聊天对话对应的id
对应的是AVOSRealtimeConversations表中的objectId
|
long |
getDeliveredAt()
获取消息成功到达接收方的时间
|
String |
getFrom()
获取消息的发送者
|
List<String> |
getMentionList()
获取 mention 用户列表
|
String |
getMentionListString()
获取 mention 用户列表的字符串(逗号分隔)
|
String |
getMessageId()
获取消息的全局Id
这个id只有在发送成功或者收到消息时才会有对应的值
|
LCIMMessage.MessageIOType |
getMessageIOType()
获取消息IO类型
|
LCIMMessage.MessageStatus |
getMessageStatus()
获取消息当前的状态
|
long |
getReadAt() |
long |
getReceiptTimestamp()
Deprecated.
Please use
getDeliveredAt()
获取消息成功到达接收方的时间 |
long |
getTimestamp()
获取消息发送的时间
|
String |
getUniqueToken() |
long |
getUpdateAt()
Deprecated.
please use getUpdatedAt instead of.
|
long |
getUpdatedAt()
get the update time of the message
|
int |
hashCode() |
boolean |
isMentionAll()
判断是否 mention 了所有人
|
boolean |
mentioned()
判断消息里面是否 mention 了当前用户
|
static LCIMMessage |
parseJSON(Map<String,Object> jsonObject) |
static LCIMMessage |
parseJSONString(String content) |
void |
setContent(String content)
设置消息体的内容
|
void |
setConversationId(String conversationId)
设置消息所在的conversationId,本方法一般用于从反序列化时
|
void |
setFrom(String from)
设置消息的发送者
|
void |
setMentionAll(boolean mentionAll)
设置是否 mention 所有人
|
void |
setMentionList(List<String> peerIdList)
设置 mention 用户列表
|
void |
setMentionListString(String content)
设置 mention 用户列表字符串(逗号分隔),功能与 #setMentionList(List peerIdList) 相同,两者调用一个即可。
|
void |
setMessageId(String messageId)
仅仅是用于反序列化消息时使用,请不要在其他时候使用
|
void |
setMessageIOType(LCIMMessage.MessageIOType ioType)
设置消息的IO类型,本方法一般用于反序列化
|
void |
setMessageStatus(LCIMMessage.MessageStatus status)
设置消息当前的状态,本方法一般用于从反序列化时
|
void |
setReadAt(long readAt) |
void |
setReceiptTimestamp(long receiptTimestamp)
Deprecated.
Please use
setDeliveredAt(long) |
void |
setTimestamp(long timestamp) |
void |
setUniqueToken(String uniqueToken) |
void |
setUpdateAt(long updateAt)
Deprecated.
please use setUpdatedAt instead of.
|
void |
setUpdatedAt(long updateAt)
set the update time of the message
|
String |
toJSONString() |
protected String conversationId
protected String content
protected byte[] bytes
protected String from
protected long timestamp
protected long deliveredAt
protected long readAt
protected long updateAt
protected boolean mentionAll
protected String currentClient
protected String messageId
protected String uniqueToken
protected LCIMMessage.MessageStatus status
protected LCIMMessage.MessageIOType ioType
public LCIMMessage()
public LCIMMessage(String conversationId, String from, long timestamp, long deliveredAt)
public String getConversationId()
public void setConversationId(String conversationId)
conversationId
- conversation id.public String getContent()
public void setContent(String content)
content
- message content.public String getFrom()
public void setFrom(String from)
from
- message senderpublic long getTimestamp()
public void setTimestamp(long timestamp)
public long getReceiptTimestamp()
getDeliveredAt()
获取消息成功到达接收方的时间public void setReceiptTimestamp(long receiptTimestamp)
setDeliveredAt(long)
receiptTimestamp
- message receipt timestamppublic long getDeliveredAt()
public void setReadAt(long readAt)
public long getReadAt()
public void setUpdateAt(long updateAt)
updateAt
- message updated timestamppublic void setUpdatedAt(long updateAt)
updateAt
- message updated timestamppublic long getUpdateAt()
public long getUpdatedAt()
public void setMessageStatus(LCIMMessage.MessageStatus status)
status
- message statuspublic LCIMMessage.MessageStatus getMessageStatus()
public LCIMMessage.MessageIOType getMessageIOType()
public void setMessageIOType(LCIMMessage.MessageIOType ioType)
ioType
- message io typepublic String getMessageId()
public void setMessageId(String messageId)
messageId
- message idpublic boolean mentioned()
public void setMentionList(List<String> peerIdList)
peerIdList
- mention peer id listpublic String getMentionListString()
public void setMentionListString(String content)
content
- mention peer id list stringpublic boolean isMentionAll()
public void setMentionAll(boolean mentionAll)
mentionAll
- flag indicating mentioned all or notprotected void generateUniqueToken()
public void setUniqueToken(String uniqueToken)
public String getUniqueToken()
public String toJSONString()
public static LCIMMessage parseJSON(Map<String,Object> jsonObject)
public static LCIMMessage parseJSONString(String content)
Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.