Class BaseMessage

    • Field Detail

      • TABLE_CONVERSATIONS

        public static final java.lang.String TABLE_CONVERSATIONS
        See Also:
        Constant Field Values
      • id

        protected int id
      • muid

        protected java.lang.String muid
      • sender

        protected User sender
      • receiverUid

        protected java.lang.String receiverUid
      • type

        protected java.lang.String type
      • receiverType

        protected java.lang.String receiverType
      • category

        protected java.lang.String category
      • sentAt

        protected long sentAt
      • deliveredAt

        protected long deliveredAt
      • readAt

        protected long readAt
      • metadata

        protected JSONObject metadata
      • readByMeAt

        protected long readByMeAt
      • deliveredToMeAt

        protected long deliveredToMeAt
      • deletedAt

        protected long deletedAt
      • editedAt

        protected long editedAt
      • deletedBy

        protected java.lang.String deletedBy
      • editedBy

        protected java.lang.String editedBy
      • updatedAt

        protected long updatedAt
      • conversationId

        protected java.lang.String conversationId
      • parentMessageId

        protected int parentMessageId
      • replyCount

        protected int replyCount
      • rawMessage

        protected JSONObject rawMessage
    • Constructor Detail

      • BaseMessage

        public BaseMessage​(java.lang.String receiverUid,
                           java.lang.String type,
                           java.lang.String receiverType)
      • BaseMessage

        public BaseMessage()
    • Method Detail

      • getId

        public int getId()
        Get id of the message
        Returns:
        unique id of the message
        Since:
        v1
      • setId

        public void setId​(int id)
      • getMuid

        public java.lang.String getMuid()
        Get muid of Message Additional id field for the developers in case they want to use.
        Returns:
        muid set by developer
        Since:
        v1
      • setMuid

        public void setMuid​(java.lang.String muid)
      • getSender

        public User getSender()
        Get sender object
        Returns:
        An object of User class
        Since:
        v1
        See Also:
        User
      • setSender

        public void setSender​(User sender)
      • getReceiverUid

        public java.lang.String getReceiverUid()
        Get id of the receiver
        Returns:
        id of the receiver(user/group)
        Since:
        v1
      • setReceiverUid

        public void setReceiverUid​(java.lang.String receiverUid)
      • getType

        public java.lang.String getType()
        Get type of the message
        Returns:
        type of the message
        Since:
        v1
      • setType

        public void setType​(java.lang.String type)
      • getReceiverType

        public java.lang.String getReceiverType()
        Get type of receiver
        Returns:
        type of the receiver
        Since:
        v1
        See Also:
        CometChatConstants.ReceiverTypes
      • setReceiverType

        public void setReceiverType​(java.lang.String receiverType)
      • getSentAt

        public long getSentAt()
        Get message's sent at timestamp
        Returns:
        message sent timestamp
        Since:
        v1
      • setSentAt

        public void setSentAt​(long sentAt)
      • getCategory

        public java.lang.String getCategory()
        Get of the category of message
        Returns:
        category of the message
        Since:
        v1
      • setCategory

        public void setCategory​(java.lang.String category)
      • getDeliveredAt

        public long getDeliveredAt()
        Get delivery timestamp of the message
        Returns:
        delivery timestamp of message
        Since:
        v1
      • setDeliveredAt

        public void setDeliveredAt​(long deliveredAt)
      • getReadAt

        public long getReadAt()
        Get Timestamp of the when message was read at
        Returns:
        Timestamp of the time the message was read at
        Since:
        v1 Note In case of group this field is set only when at message is read by all the member of the group
      • setReadAt

        public void setReadAt​(long readAt)
      • getMetadata

        public JSONObject getMetadata()
        Get JSONObject of data set by developer
        Returns:
        JSONObject of custom data set by developer
        Since:
        v1
      • setMetadata

        public void setMetadata​(JSONObject metadata)
      • getReadByMeAt

        public long getReadByMeAt()
        Get timestamp when the message is read by logged in user
        Returns:
        read at of the message
        Since:
        v1
      • setReadByMeAt

        public void setReadByMeAt​(long readByMeAt)
      • getDeliveredToMeAt

        public long getDeliveredToMeAt()
        Get timestamp of the message at which it was delivered to logged in user
        Returns:
        delivery timestamp of the message
        Since:
        v1
      • setDeliveredToMeAt

        public void setDeliveredToMeAt​(long deliveredToMeAt)
      • getDeletedAt

        public long getDeletedAt()
        Get timestamp of the message when it was deleted
        Returns:
        deleted at timestamp
        Since:
        v1
      • setDeletedAt

        public void setDeletedAt​(long deletedAt)
      • getEditedAt

        public long getEditedAt()
        Get timestamp of the message when it was updated/edited
        Returns:
        edited/updated at timestamp
        Since:
        v1
      • setEditedAt

        public void setEditedAt​(long editedAt)
      • getDeletedBy

        public java.lang.String getDeletedBy()
        Get UID of the user who deleted the message
        Returns:
        UID of the user
        Since:
        v1
      • setDeletedBy

        public void setDeletedBy​(java.lang.String deletedBy)
      • getEditedBy

        public java.lang.String getEditedBy()
        Get UID of the user who edited/updated the message
        Returns:
        UID of the user
        Since:
        v1
      • setEditedBy

        public void setEditedBy​(java.lang.String editedBy)
      • getUpdatedAt

        public long getUpdatedAt()
        Get timestamp of the message when it was updated/edited
        Returns:
        updated/edited at timestamp
        Since:
        v1
      • setUpdatedAt

        public void setUpdatedAt​(long updatedAt)
      • getConversationId

        public java.lang.String getConversationId()
        Returns the id of the Conversation.
        Returns:
        conversationId
        Since:
        v2
      • setConversationId

        public void setConversationId​(java.lang.String conversationId)
      • getReceiver

        public AppEntity getReceiver()
        Returns User/Group object with the details of the receiver of the message.
        Returns:
        User/Group object with the details of the receiever of the message.
        Since:
        v2
      • setReceiver

        public void setReceiver​(AppEntity receiver)
      • getParentMessageId

        public int getParentMessageId()
        Returns the parent message id for the message showing that the message belongs to a thread.
        Returns:
        an int which is the parent message id for the message showing that the message belongs to a thread.
        Since:
        v2
      • setParentMessageId

        public void setParentMessageId​(int parentMessageId)
      • getReplyCount

        public int getReplyCount()
        Returns the count of the messages that belong to the thread for which the message is the parent.
        Returns:
        an int which is the count of the messages that belong to the thread for which the message is the parent.
        Since:
        v2
      • setReplyCount

        public void setReplyCount​(int replyCount)
      • getRawMessage

        public JSONObject getRawMessage()
        Returns the raw JSON message for the message object.
        Returns:
        A JSONObject which holds the raw data of the message..
        Since:
        v2
      • setRawMessage

        public void setRawMessage​(JSONObject rawMessage)
      • getMessagesFromJSON

        public static java.util.List<BaseMessage> getMessagesFromJSON​(java.lang.String json)
                                                               throws JSONException
        Throws:
        JSONException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object