Package im.getsocial.sdk.communities
Class ActivityContent
- java.lang.Object
-
- im.getsocial.sdk.communities.ActivityContent
-
public class ActivityContent extends java.lang.Object
Content to post in the feed.
-
-
Constructor Summary
Constructors Constructor Description ActivityContent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActivityContent
addAttachment(MediaAttachment attachment)
Add attachment to the post.ActivityContent
addLabel(java.lang.String label)
Add custom label to the post.ActivityContent
addLabels(java.util.List<java.lang.String> labels)
Same asaddLabel(String)
, but add multiple values at the same time.ActivityContent
addProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Same asaddProperty(String, String)
, but add multiple values at the same time.ActivityContent
addProperty(java.lang.String key, java.lang.String value)
Add custom property to the post.static ActivityContent
createWithAttachment(MediaAttachment attachment)
Create a content with a single attachment.static ActivityContent
createWithText(java.lang.String text)
Create a content with text.java.util.List<MediaAttachment>
getAttachments()
ActivityButton
getButton()
java.util.List<java.lang.String>
getLabels()
PollContent
getPoll()
java.util.Map<java.lang.String,java.lang.String>
getProperties()
java.lang.String
getText()
ActivityContent
withButton(ActivityButton button)
Set action button.ActivityContent
withPoll(PollContent pollContent)
Set poll.ActivityContent
withText(java.lang.String text)
Set text of the post.
-
-
-
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.
-
createWithAttachment
public static ActivityContent 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 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 asaddProperty(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 asaddLabel(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.
-
-