Class Message
-
- All Implemented Interfaces:
-
android.os.Parcelable,kotlin.Comparable
public final class Message implements Comparable<Message>, Parcelable
Marigold Message representation
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringTYPE_TEXTpublic final static StringTYPE_VIDEOpublic final static StringTYPE_LINKpublic final static StringTYPE_IMAGEpublic final static StringTYPE_PUSHpublic final static Parcelable.Creator<Message>CREATORprivate final Stringtitleprivate final StringmessageIDprivate final Stringtextprivate final Stringtypeprivate final StringcontentURLprivate final StringmediaURLprivate final StringimageURLprivate final StringhtmlTextprivate final BooleanisShareableprivate final BooleanisReadprivate final DatecreatedAtprivate final HashMap<String, String>attributes
-
Method Summary
Modifier and Type Method Description final StringgetTitle()The title of the Message final StringgetMessageID()The ID of the Message final StringgetText()The body text of the Message. final StringgetType()The type of this message: Text, Image, Video, Link, or Fake Call. final StringgetContentURL()The content's URL if this is a TYPE_LINKMessage.final StringgetMediaURL()If Message is of type TYPE_VIDEO, this links to the video content.final StringgetImageURL()URL of the Message's image. final StringgetHtmlText()The formatted HTML text of the Message final BooleanisShareable()Boolean stating if this Message has sharing enabled. final BooleanisRead()Internal method for setting read state via MessageStream setMessagesRead(). final DategetCreatedAt()Created date of the Message. final HashMap<String, String>getAttributes()final JSONObjecttoJSON()Converts Message to JSON. UnitwriteToParcel(Parcel dest, Integer flags)IntegercompareTo(Message other)Compares this object to the specified object to determine their relative order by created date in descending order. Booleanequals(Object other)IntegerhashCode()IntegerdescribeContents()-
-
Method Detail
-
getMessageID
final String getMessageID()
The ID of the Message
- Returns:
String message ID
-
getType
final String getType()
The type of this message: Text, Image, Video, Link, or Fake Call.
- Returns:
the type
-
getContentURL
final String getContentURL()
The content's URL if this is a
TYPE_LINKMessage.- Returns:
String contentURL
-
getMediaURL
final String getMediaURL()
If Message is of type
TYPE_VIDEO, this links to the video content.- Returns:
the mediaURL
-
getImageURL
final String getImageURL()
URL of the Message's image.
- Returns:
the image URL
-
getHtmlText
final String getHtmlText()
The formatted HTML text of the Message
- Returns:
the formatted body text
-
isShareable
final Boolean isShareable()
Boolean stating if this Message has sharing enabled.
- Returns:
true if this message able to be shared outside of the app. Otherwise false.
-
isRead
final Boolean isRead()
Internal method for setting read state via MessageStream setMessagesRead().
-
getCreatedAt
final Date getCreatedAt()
Created date of the Message.
- Returns:
the createdAt
-
getAttributes
final HashMap<String, String> getAttributes()
-
toJSON
final JSONObject toJSON()
Converts Message to JSON. Do not alter the signature of this method without updating the Cordova/Unity/etc wrappers. Wrappers use reflection to access this method.
- Returns:
JSON representation of a Message
-
writeToParcel
Unit writeToParcel(Parcel dest, Integer flags)
-
compareTo
Integer compareTo(Message other)
Compares this object to the specified object to determine their relative order by created date in descending order.
- Parameters:
other- the object to compare to this instance.- Returns:
a negative integer if this instance is less than another; a positive integer if this instance is greater than another; 0 if this instance has the same order as another
-
describeContents
Integer describeContents()
-
-
-
-