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 String
TYPE_TEXT
public final static String
TYPE_VIDEO
public final static String
TYPE_LINK
public final static String
TYPE_IMAGE
public final static String
TYPE_PUSH
public final static Parcelable.Creator<Message>
CREATOR
private final String
title
private final String
messageID
private final String
text
private final String
type
private final String
contentURL
private final String
mediaURL
private final String
imageURL
private final String
htmlText
private final Boolean
isShareable
private final Boolean
isRead
private final Date
createdAt
private final HashMap<String, String>
attributes
-
Method Summary
Modifier and Type Method Description final String
getTitle()
The title of the Message final String
getMessageID()
The ID of the Message final String
getText()
The body text of the Message. final String
getType()
The type of this message: Text, Image, Video, Link, or Fake Call. final String
getContentURL()
The content's URL if this is a TYPE_LINK
Message.final String
getMediaURL()
If Message is of type TYPE_VIDEO
, this links to the video content.final String
getImageURL()
URL of the Message's image. final String
getHtmlText()
The formatted HTML text of the Message final Boolean
isShareable()
Boolean stating if this Message has sharing enabled. final Boolean
isRead()
Internal method for setting read state via MessageStream setMessagesRead(). final Date
getCreatedAt()
Created date of the Message. final HashMap<String, String>
getAttributes()
final JSONObject
toJSON()
Converts Message to JSON. Unit
writeToParcel(Parcel dest, Integer flags)
Integer
compareTo(Message other)
Compares this object to the specified object to determine their relative order by created date in descending order. Boolean
equals(Object other)
Integer
hashCode()
Integer
describeContents()
-
-
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_LINK
Message.- 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()
-
-
-
-