Class ChatMessageContent


  • public class ChatMessageContent
    extends java.lang.Object
    Content to post a chat 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.
      • 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 as addProperty(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.