Package im.getsocial.sdk.communities
Class GetSocialActivity
- java.lang.Object
-
- im.getsocial.sdk.communities.GetSocialActivity
-
public class GetSocialActivity extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GetSocialActivity(java.lang.String id, java.lang.String text, User author, java.util.List<MediaAttachment> attachments, java.lang.String type, boolean announcement, java.util.Set<User> commenters, java.util.List<GetSocialActivity> comments, int commentsCount, java.util.List<UserReactions> reactors, java.util.Map<java.lang.String,java.lang.Integer> reactionsCount, java.util.Set<java.lang.String> myReactions, java.util.Map<java.lang.String,java.lang.String> properties, long createdAt, java.util.List<Mention> mentions, ActivityButton button, CommunitiesEntity source, java.lang.String status, Poll poll, double popularity, java.util.List<java.lang.String> labels, boolean isBookmarked, int bookmarksCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MediaAttachment>
getAttachments()
List of attachments in the same order as was posted.User
getAuthor()
Author of the activity.int
getBookmarksCount()
Number of bookmarks for the activity.ActivityButton
getButton()
Action button, attached to the activity.java.util.Set<User>
getCommenters()
Get known commenters.java.util.List<GetSocialActivity>
getComments()
Comments under the activity.int
getCommentsCount()
Number of comments under the activity.long
getCreatedAt()
java.lang.String
getId()
Unique identifier of the activity.java.util.List<java.lang.String>
getLabels()
Get custom labels of the activity attached when it was posted.java.util.List<Mention>
getMentions()
Get list of mentions in the activity.java.util.Set<java.lang.String>
getMyReactions()
Get set of reactions to the activity by a current user.Poll
getPoll()
Get poll.java.lang.Double
getPopularity()
Popularity, calculated based on comments and reactions.java.util.Map<java.lang.String,java.lang.String>
getProperties()
Get custom data of the activity attached when it was posted.int
getReactionCount(java.lang.String reaction)
Get number of users who reacted with particular reaction.java.util.List<UserReactions>
getReactions()
Get reactions of known users.java.util.Map<java.lang.String,java.lang.Integer>
getReactionsCount()
Map of the reactions count.CommunitiesEntity
getSource()
Source of the activity, describes where it was posted.java.lang.String
getStatus()
Get status of the activity.java.lang.String
getText()
Get localized text of the activity.int
getTotalReactionsCount()
Get total number of reactions.java.lang.String
getType()
Type of post.boolean
isAnnouncement()
Indicates if activity is announcement or just regular post.boolean
isBookmarked()
Indicates if activity is bookmarked by the current userjava.lang.String
toString()
-
-
-
Constructor Detail
-
GetSocialActivity
public GetSocialActivity(java.lang.String id, java.lang.String text, User author, java.util.List<MediaAttachment> attachments, java.lang.String type, boolean announcement, java.util.Set<User> commenters, java.util.List<GetSocialActivity> comments, int commentsCount, java.util.List<UserReactions> reactors, java.util.Map<java.lang.String,java.lang.Integer> reactionsCount, java.util.Set<java.lang.String> myReactions, java.util.Map<java.lang.String,java.lang.String> properties, long createdAt, java.util.List<Mention> mentions, @Nullable ActivityButton button, CommunitiesEntity source, java.lang.String status, @Nullable Poll poll, double popularity, java.util.List<java.lang.String> labels, boolean isBookmarked, int bookmarksCount)
-
-
Method Detail
-
getId
public java.lang.String getId()
Unique identifier of the activity.- Returns:
- id.
-
getSource
public CommunitiesEntity getSource()
Source of the activity, describes where it was posted.- Returns:
- entity to which the activity was posted.
-
getText
public java.lang.String getText()
Get localized text of the activity.- Returns:
- localized text.
-
getAuthor
public User getAuthor()
Author of the activity. Could be application.- Returns:
- post author.
-
getAttachments
public java.util.List<MediaAttachment> getAttachments()
List of attachments in the same order as was posted.- Returns:
- list of video/image URLs.
-
getType
public java.lang.String getType()
Type of post. One ofActivityType
.- Returns:
- activity type.
-
getButton
@Nullable public ActivityButton getButton()
Action button, attached to the activity.- Returns:
- button object, or null if there is no button.
-
isAnnouncement
public boolean isAnnouncement()
Indicates if activity is announcement or just regular post.- Returns:
- true, if activity is announcement, false otherwise.
-
getCommenters
public java.util.Set<User> getCommenters()
Get known commenters.- Returns:
- list of known commenters.
-
getCommentsCount
public int getCommentsCount()
Number of comments under the activity.- Returns:
- total number of comments to this activity.
-
getComments
public java.util.List<GetSocialActivity> getComments()
Comments under the activity. Only included if `includeComments` was defined in the `ActivitiesQuery`.- Returns:
- comments to this activity.
-
getReactions
public java.util.List<UserReactions> getReactions()
Get reactions of known users.- Returns:
- list of reactions of known users.
-
getReactionsCount
public java.util.Map<java.lang.String,java.lang.Integer> getReactionsCount()
Map of the reactions count. Key is reaction name - one ofReactions
. Value is number of users reacted with this reaction. UsegetReactionCount(String)
orgetTotalReactionsCount()
for null-pointer safety.- Returns:
- map of reactions names and number of users reacted.
-
getReactionCount
public int getReactionCount(java.lang.String reaction)
Get number of users who reacted with particular reaction.- Parameters:
reaction
- name of the reaction. One ofReactions
.- Returns:
- number of users reacted with this reaction. Returns 0 if there is no such reaction or no users reacted with it.
-
getTotalReactionsCount
public int getTotalReactionsCount()
Get total number of reactions. Multiple reaction of the same user counts separately.- Returns:
- total number of reactions.
-
getMyReactions
public java.util.Set<java.lang.String> getMyReactions()
Get set of reactions to the activity by a current user.- Returns:
- reactions by current user.
-
isBookmarked
public boolean isBookmarked()
Indicates if activity is bookmarked by the current user- Returns:
- true, if activity is bookmarked, false otherwise.
-
getBookmarksCount
public int getBookmarksCount()
Number of bookmarks for the activity.- Returns:
- total number of bookmarks for this activity.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Get custom data of the activity attached when it was posted.- Returns:
- map of custom values, attached to the activity.
-
getCreatedAt
public long getCreatedAt()
- Returns:
- activity's creation date in seconds in Unix time.
-
getMentions
public java.util.List<Mention> getMentions()
Get list of mentions in the activity. CheckMention
for more details.- Returns:
- list of mentioned users.
-
getStatus
public java.lang.String getStatus()
Get status of the activity. CheckGetSocialActivityStatus
for more details.- Returns:
- current status.
-
getPoll
@Nullable public Poll getPoll()
Get poll. CheckPoll
for more details.- Returns:
- current status.
-
getPopularity
@Nullable public java.lang.Double getPopularity()
Popularity, calculated based on comments and reactions.- Returns:
- popularity.
-
getLabels
public java.util.List<java.lang.String> getLabels()
Get custom labels of the activity attached when it was posted.- Returns:
- list of custom values, attached to the activity.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-