Package im.getsocial.sdk.communities
Class ChatMessageContent
- java.lang.Object
-
- im.getsocial.sdk.communities.ChatMessageContent
-
public class ChatMessageContent extends java.lang.Object
Content to post a chat message.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChatMessageContent
addAttachment(MediaAttachment attachment)
Add attachment to the message.ChatMessageContent
addProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Same asaddProperty(String, String)
, but add multiple values at the same time.ChatMessageContent
addProperty(java.lang.String key, java.lang.String value)
Add custom property to the message.static ChatMessageContent
createWithAttachment(MediaAttachment attachment)
Create a content with a single attachment.static ChatMessageContent
createWithText(java.lang.String text)
Create a content with text.java.util.List<MediaAttachment>
getAttachments()
java.util.Map<java.lang.String,java.lang.String>
getProperties()
java.lang.String
getText()
ChatMessageContent
withText(java.lang.String text)
Set text of the message.
-
-
-
Method Detail
-
createWithText
public static ChatMessageContent createWithText(java.lang.String text)
Create a content with text.- Parameters:
text
- text to be posted in the feed.- Returns:
- new instance.
-
createWithAttachment
public static ChatMessageContent createWithAttachment(MediaAttachment attachment)
Create a content with a single attachment. You can add more attachments to it withaddAttachment(MediaAttachment)
.- Parameters:
attachment
- media attachment.- Returns:
- new instance,
-
addAttachment
public ChatMessageContent addAttachment(MediaAttachment attachment)
Add attachment to the message. Attachments will be returned in the same order as added.- Parameters:
attachment
- media attachment.- Returns:
- same instance for a method chaining.
-
withText
public ChatMessageContent withText(java.lang.String text)
Set text of the message. Will override the previous value if it was set.- Parameters:
text
- post text.- Returns:
- same instance for a method chaining.
-
addProperty
public ChatMessageContent addProperty(java.lang.String key, java.lang.String value)
Add custom property to the message.- Parameters:
key
- you can get the property value by this key in future.value
- arbitrary value.- Returns:
- same instance for a method chaining.
-
addProperties
public ChatMessageContent addProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Same asaddProperty(String, String)
, but add multiple values at the same time.- Parameters:
properties
- map of properties.- Returns:
- same instance for a method chaining.
-
getText
public java.lang.String getText()
- Returns:
- text of message. Null if text was not set.
-
getAttachments
public java.util.List<MediaAttachment> getAttachments()
- Returns:
- list of attachments. Empty if no attachments added.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
- Returns:
- list of properties. Empty if no properties added.
-
-