public class QBChatMessage
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
QBChatMessage()
Constructs a new QBChatMessage object.
|
QBChatMessage(Message smackMessage) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAttachment(QBAttachment attachment)
Add an attachment.
|
static Message |
buildDeliveredOrReadStatusMessage(boolean delivered,
java.lang.Integer senderId,
java.lang.String originMessageID,
java.lang.String dialogId) |
static Message |
buildTypingStatusMessage(java.lang.String to,
Message.Type type,
ChatState chatState) |
boolean |
equals(java.lang.Object o) |
java.util.Collection<QBAttachment> |
getAttachments()
Gets the array of attachments.
|
java.lang.String |
getBody()
Gets the body.
|
long |
getDateSent()
Gets the date sent value
|
java.util.Collection<java.lang.Integer> |
getDeliveredIds()
Gets the array of users who received the message.
|
java.lang.String |
getDialogId()
Gets the dialog ID of a Message.
|
java.lang.String |
getId()
Gets the ID of a message.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Gets a map of message's properties
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the message custom property with the specified name or null if the
property doesn't exist.
|
java.util.Collection<java.lang.String> |
getPropertyNames()
Gets a collection of all the custom properties names that are set.
|
java.util.Collection<java.lang.Integer> |
getReadIds()
Gets the array of users who read the message.
|
java.lang.Integer |
getRecipientId()
Gets the recipient user ID.
|
java.lang.Integer |
getSenderId()
Gets the sender user ID.
|
Message |
getSmackMessage() |
int |
hashCode() |
boolean |
isDelayed()
Is this message delayed, for example a user was offline when another sent the message to him.
|
boolean |
isMarkable()
Returns true if the message marked as markable.
|
boolean |
removeAttachment(QBAttachment attachment)
Remove an attachment.
|
java.lang.Object |
removeComplexProperty(java.lang.String name)
Deletes a complex property.
|
java.lang.String |
removeProperty(java.lang.String name)
Deletes a custom property.
|
void |
removeQBChatUnMarkedMessageExtension() |
void |
setAttachments(java.util.Collection<QBAttachment> attachments)
Sets the attachments
|
void |
setBody(java.lang.String body)
Sets the body.
|
java.lang.Object |
setComplexProperty(java.lang.String name,
java.lang.Object value)
Adds complex property.
|
void |
setDateSent(long dateSent)
Sets the date sent value
|
void |
setDeliveredIds(java.util.Collection<java.lang.Integer> deliveredIds) |
void |
setDialogId(java.lang.String dialogId)
Sets the dialog id
|
void |
setId(java.lang.String id)
Sets the ID of a Message.
|
void |
setMarkable(boolean markable)
Marks message as markable.
|
java.lang.String |
setProperty(java.lang.String name,
java.lang.String value)
Adds custom property to a message
|
void |
setQBChatUnMarkedMessageExtension(QBChatMessageExtension packetExtension) |
void |
setReadIds(java.util.Collection<java.lang.Integer> readIds) |
void |
setRecipientId(java.lang.Integer recipientId)
Sets the recipient user ID.
|
void |
setSaveToHistory(boolean saveToHistory)
Mark message to be saved to message history.
|
void |
setSenderId(java.lang.Integer senderId)
Sets the sender id
|
java.lang.String |
toString() |
public QBChatMessage()
public QBChatMessage(Message smackMessage)
public java.lang.String getId()
public void setId(java.lang.String id)
id - - is string representation of globally unique identifier for objects.public java.lang.String getDialogId()
public void setDialogId(java.lang.String dialogId)
dialogId - The ID of a dialog to setpublic java.lang.Integer getSenderId()
public void setSenderId(java.lang.Integer senderId)
senderId - The sender user ID to set.public boolean isDelayed()
public java.lang.Integer getRecipientId()
public void setRecipientId(java.lang.Integer recipientId)
recipientId - The value to setpublic java.lang.String getBody()
public void setBody(java.lang.String body)
body - The value to setpublic boolean isMarkable()
public void setMarkable(boolean markable)
public java.util.Collection<QBAttachment> getAttachments()
public void setAttachments(java.util.Collection<QBAttachment> attachments)
attachments - The attachments to setpublic boolean addAttachment(QBAttachment attachment)
attachment - An instance of QBAttachment to add.QBAttachmentpublic boolean removeAttachment(QBAttachment attachment)
attachment - An instance of QBAttachment to remove.QBAttachmentpublic java.util.Collection<java.lang.Integer> getReadIds()
public void setReadIds(java.util.Collection<java.lang.Integer> readIds)
public java.util.Collection<java.lang.Integer> getDeliveredIds()
public void setDeliveredIds(java.util.Collection<java.lang.Integer> deliveredIds)
public java.lang.Object getProperty(java.lang.String name)
name - The custom property name.public java.util.Collection<java.lang.String> getPropertyNames()
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public java.lang.String setProperty(java.lang.String name,
java.lang.String value)
name - The name of the property.value - The value of the property.public java.lang.String removeProperty(java.lang.String name)
name - The name of the property to delete.public java.lang.Object setComplexProperty(java.lang.String name,
java.lang.Object value)
name - The name of the property.value - The value of the property.public java.lang.Object removeComplexProperty(java.lang.String name)
name - The name of the property to delete.public long getDateSent()
public void setDateSent(long dateSent)
dateSent - The value to setpublic void setSaveToHistory(boolean saveToHistory)
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic void setQBChatUnMarkedMessageExtension(QBChatMessageExtension packetExtension)
public void removeQBChatUnMarkedMessageExtension()
public Message getSmackMessage()
public static Message buildDeliveredOrReadStatusMessage(boolean delivered,
java.lang.Integer senderId,
java.lang.String originMessageID,
java.lang.String dialogId)
public static Message buildTypingStatusMessage(java.lang.String to,
Message.Type type,
ChatState chatState)