Class ActivityContent


  • public class ActivityContent
    extends java.lang.Object
    Content to post in the feed.
    • Constructor Detail

      • ActivityContent

        public ActivityContent()
    • Method Detail

      • createWithText

        public static ActivityContent createWithText​(java.lang.String text)
        Create a content with text.
        Parameters:
        text - text to be posted in the feed.
        Returns:
        new instance.
      • addAttachment

        public ActivityContent addAttachment​(MediaAttachment attachment)
        Add attachment to the post. Attachments will be returned in the same order as added.
        Parameters:
        attachment - media attachment.
        Returns:
        same instance for a method chaining.
      • withText

        public ActivityContent withText​(java.lang.String text)
        Set text of the post. Will override the previous value if it was set.
        Parameters:
        text - post text.
        Returns:
        same instance for a method chaining.
      • withButton

        public ActivityContent withButton​(ActivityButton button)
        Set action button. Will override the previous value if it was set.
        Parameters:
        button - action button.
        Returns:
        same instance for a method chaining.
      • withPoll

        public ActivityContent withPoll​(PollContent pollContent)
        Set poll. Will override the previous value if it was set.
        Parameters:
        pollContent - PollContent instance.
        Returns:
        same instance for a method chaining.
      • addProperty

        public ActivityContent addProperty​(java.lang.String key,
                                           java.lang.String value)
        Add custom property to the post.
        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 ActivityContent 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.
      • addLabel

        public ActivityContent addLabel​(java.lang.String label)
        Add custom label to the post.
        Parameters:
        label - Custom label.
        Returns:
        same instance for a method chaining.
      • addLabels

        public ActivityContent addLabels​(java.util.List<java.lang.String> labels)
        Same as addLabel(String), but add multiple values at the same time.
        Parameters:
        labels - list of labels.
        Returns:
        same instance for a method chaining.
      • getText

        public java.lang.String getText()
        Returns:
        text of post. 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.
      • getButton

        public ActivityButton getButton()
        Returns:
        action button. Null if button is not set.
      • getPoll

        public PollContent getPoll()
        Returns:
        poll. Null if poll is not set.
      • getLabels

        public java.util.List<java.lang.String> getLabels()
        Returns:
        list of labels. Empty if no labels added.