Package com.restfb.types
Class Post
java.lang.Object
com.restfb.types.AbstractFacebookType
com.restfb.types.FacebookType
com.restfb.types.Post
- All Implemented Interfaces:
HasComments,HasCreatedTime,HasMessage,Serializable
Represents the Post Graph API type.
- Since:
- 1.5
- Author:
- Mark Allen
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the Action Graph API type.static classRepresents the attachments included inGraph API Post type.static classObject that controls news feed targeting for this post.static classstatic classRepresents the undocumentedPropertytype.static classRepresents the Shares included the Post response.static classNested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAction(Post.Action action) voidaddChildAttachment(Post childAttachment) voidaddMessageTag(MessageTag messageTag) booleanaddProperty(Post.Property property) booleanaddSponsorTag(NamedFacebookType sponsorTag) voidaddStoryTag(MessageTag messageTag) booleanaddTo(NamedFacebookType profile) A list of available action names and links (including commenting, liking, and an optional app-specified action).ID of admin who created the post.Objectives under which this post can be advertisedObjectives under which this post can be advertisedThe application used to create this post.Attachments added to a post.The call to action type used in any Page posts for mobile app engagement adsWhether the viewer can send a private reply to this post (Page viewers only)The caption of the link (appears beneath the link name).Sub-shares of a multi-link share postThe comments for this post.The number of comments of this post.If comments are being mirrored to an external site, this function returns the domain of that external site.The time the post was initially published.A description of the link (appears beneath the link caption).getEvent()If this Post has a place, the event associated with the placeObject that controls news feed targeting for this post.getFrom()An object containing the ID and name of the user who posted the message.Full picture URL.getIcon()A link to an icon representing the type of this post.Whether the post can be promoted on Instagram.Whether or not the post references an app.Whether the post has expiration time that has passedIf this post is marked as hidden (applies to Pages only).Returns True if the post was created inline when creating ads.Whether this post can be promoted in Instagram.Whether the post is currently popular.Indicates whether a scheduled post was published.Whether the post is a spherical video post.getLikes()Duplicate mapping for "likes" since FB can return it differently in different situations. -- GETTER -- The likes on this post.The number of likes on this post.getLink()The link attached to this post.The message.Objects tagged in the message (Users, Pages, etc).Whether display the end card for a multi-link share postWhether automatically select the order of the links in multi-link share post when used in an adgetName()The name of the link.The Facebook object id for an uploaded photo or video.ID of the parent postThe permanent static URL to the post on www.facebook.com.If available, a link to the picture included with this post.getPlace()The place where this post occurred.The privacy settings for this post.ID of post to use for promotion for stories that cannot be promoted directlyStatus of the promotion, if the post was promoted.A list of properties for this post.The reactions for this post.The number of reactions on this post.UNIX timestamp of the scheduled publish time for the post.Number of times the post has been shared.The number of shares of this post.If available, the source link attached to this post (for example, a flash or video file).A sponsor tag points to a Facebook Page.Thestatus_typeof post this is, for example"approved_friend".getStory()Text from stories not intentionally generated by usersObjects tagged in the story (Users, Pages, etc).This field is available on tagged Posts.The profile this was posted on if different from the author.Ads targeting information of the post.Timeline visibility information of the post.getTo()A list of the profiles mentioned or targeted in this post.getType()A string indicating the object type of this post.The time of the last comment on this post.getVia()ID of the user or Page the post was shared fromgetWidth()protected voidjsonMappingCompleted(JsonMapper jsonMapper) Post-JSON-mapping operation that populates themessageTagsfield "by hand".booleanremoveAction(Post.Action action) voidremoveChildAttachment(Post childAttachment) voidremoveMessageTag(MessageTag messageTag) booleanremoveProperty(Post.Property property) booleanremoveSponsorTag(NamedFacebookType sponsorTag) voidremoveStoryTag(MessageTag messageTag) booleanremoveTo(NamedFacebookType profile) voidsetAdminCreator(NamedFacebookType adminCreator) ID of admin who created the post.voidsetAllowedAdvertisingObjectives(List<String> allowedAdvertisingObjectives) Objectives under which this post can be advertisedvoidsetAllowedAdvertisingObjects(String allowedAdvertisingObjects) Objectives under which this post can be advertisedvoidsetApplication(NamedFacebookType application) The application used to create this post.voidsetAttachments(Post.Attachments attachments) Attachments added to a post.voidsetCallToAction(PostCallToAction callToAction) The call to action type used in any Page posts for mobile app engagement adsvoidsetCanReplyPrivately(Boolean canReplyPrivately) Whether the viewer can send a private reply to this post (Page viewers only)voidsetCaption(String caption) The caption of the link (appears beneath the link name).voidsetComments(Comments comments) The comments for this post.voidsetCommentsMirroringDomain(String commentsMirroringDomain) If comments are being mirrored to an external site, this function returns the domain of that external site.voidsetCreatedTime(Date createdTime) The time the post was initially published.voidsetDescription(String description) A description of the link (appears beneath the link caption).voidIf this Post has a place, the event associated with the placevoidsetExpandedHeight(Long expandedHeight) voidsetExpandedWidth(Long expandedWidth) voidsetFeedTargeting(Post.FeedTargeting feedTargeting) Object that controls news feed targeting for this post.voidAn object containing the ID and name of the user who posted the message.voidsetFullPicture(String fullPicture) Full picture URL.voidvoidA link to an icon representing the type of this post.voidsetInsights(Connection<Insight> insights) voidsetInstagramEligibility(String instagramEligibility) Whether the post can be promoted on Instagram.voidsetIsAppShare(Boolean isAppShare) Whether or not the post references an app.voidsetIsEligibleForPromotion(Boolean isEligibleForPromotion) voidsetIsExpired(Boolean isExpired) Whether the post has expiration time that has passedvoidsetIsHidden(Boolean isHidden) If this post is marked as hidden (applies to Pages only).voidsetIsInlineCreated(Boolean isInlineCreated) Returns True if the post was created inline when creating ads.voidsetIsInstagramEligible(Boolean isInstagramEligible) Whether this post can be promoted in Instagram.voidsetIsPopular(Boolean isPopular) Whether the post is currently popular.voidsetIsPublished(Boolean isPublished) Indicates whether a scheduled post was published.voidsetIsSpherical(Boolean isSpherical) Whether the post is a spherical video post.voidDuplicate mapping for "likes" since FB can return it differently in different situations. -- GETTER -- The likes on this post.voidThe link attached to this post.voidsetMessage(String message) The message.voidsetMultiShareEndCard(Boolean multiShareEndCard) Whether display the end card for a multi-link share postvoidsetMultiShareOptimized(Boolean multiShareOptimized) Whether automatically select the order of the links in multi-link share post when used in an advoidThe name of the link.voidsetObjectId(String objectId) The Facebook object id for an uploaded photo or video.voidsetParentId(String parentId) ID of the parent postvoidsetPermalinkUrl(String permalinkUrl) The permanent static URL to the post on www.facebook.com.voidsetPicture(String picture) If available, a link to the picture included with this post.voidThe place where this post occurred.voidsetPrivacy(Privacy privacy) The privacy settings for this post.voidsetPromotableId(String promotableId) ID of post to use for promotion for stories that cannot be promoted directlyvoidsetPromotionStatus(String promotionStatus) Status of the promotion, if the post was promoted.voidsetReactions(Reactions reactions) The reactions for this post.voidsetScheduledPublishTime(Date scheduledPublishTime) UNIX timestamp of the scheduled publish time for the post.voidsetShares(Post.Shares shares) Number of times the post has been shared.voidIf available, the source link attached to this post (for example, a flash or video file).voidsetStatusType(String statusType) Thestatus_typeof post this is, for example"approved_friend".voidText from stories not intentionally generated by usersvoidsetTaggedTime(Date taggedTime) This field is available on tagged Posts.voidsetTarget(NamedFacebookType target) The profile this was posted on if different from the author.voidsetTargeting(Post.Targeting targeting) Ads targeting information of the post.voidsetTimelineVisibility(String timelineVisibility) Timeline visibility information of the post.voidsetUpdatedTime(Date updatedTime) The time of the last comment on this post.voidID of the user or Page the post was shared fromvoidsetVideoBuyingEligibility(List<String> videoBuyingEligibility) voidMethods inherited from class com.restfb.types.FacebookType
getId, getMetadata, setId, setMetadata, setTypeMethods inherited from class com.restfb.types.AbstractFacebookType
equals, hashCode, toString
-
Constructor Details
-
Post
public Post()
-
-
Method Details
-
getType
A string indicating the object type of this post. Hint for Graph API 3.3:attachment/media_typeIf there is noattachmentormedia_type=link, the value is the same astype=status.- Overrides:
getTypein classFacebookType- Returns:
- A string indicating the object type of this post.
-
jsonMappingCompleted
Post-JSON-mapping operation that populates themessageTagsfield "by hand".This is a temporary hack until we have formal public support for it/improved
JsonMappercapabilities so it can handle arbitrary Map types.- Parameters:
jsonMapper- TheJsonMapperthat was used to map to this type.- Since:
- 1.6.11
-
getLikesCount
The number of likes on this post.- Returns:
- The number of likes on this post.
-
getReactionsCount
The number of reactions on this post.- Returns:
- The number of reactions on this post.
-
getCommentsCount
The number of comments of this post.- Returns:
- The number of comments of this post.
-
getTo
A list of the profiles mentioned or targeted in this post.- Returns:
- A list of the profiles mentioned or targeted in this post.
-
addTo
-
removeTo
-
getActions
A list of available action names and links (including commenting, liking, and an optional app-specified action).- Returns:
- A list of available action names and links (including commenting, liking, and an optional app-specified action).
-
addAction
-
removeAction
-
getProperties
A list of properties for this post.This field is undocumented.
- Returns:
- A list of properties for this post.
-
addProperty
-
removeProperty
-
getMessageTags
Objects tagged in the message (Users, Pages, etc).- Returns:
- Objects tagged in the message (Users, Pages, etc).
- Since:
- 1.6.10
-
addMessageTag
-
removeMessageTag
-
getStoryTags
Objects tagged in the story (Users, Pages, etc).- Returns:
- Objects tagged in the story (Users, Pages, etc).
-
addStoryTag
-
removeStoryTag
-
getChildAttachments
Sub-shares of a multi-link share post- Returns:
- Sub-shares of a multi-link share post
-
addChildAttachment
-
removeChildAttachment
-
getSponsorTags
A sponsor tag points to a Facebook Page. (Page owners can allow their business partners to directly boost their posts.) -
addSponsorTag
-
removeSponsorTag
-
getFrom
An object containing the ID and name of the user who posted the message.- Returns:
- An object containing the ID and name of the user who posted the message.
-
setFrom
An object containing the ID and name of the user who posted the message. -
getAllowedAdvertisingObjects
Objectives under which this post can be advertised- Returns:
- Objectives under which this post can be advertised
-
setAllowedAdvertisingObjects
Objectives under which this post can be advertised -
getAllowedAdvertisingObjectives
Objectives under which this post can be advertised- Returns:
- Objectives under which this post can be advertised
-
setAllowedAdvertisingObjectives
Objectives under which this post can be advertised -
getCallToAction
The call to action type used in any Page posts for mobile app engagement ads -
setCallToAction
The call to action type used in any Page posts for mobile app engagement ads -
getCommentsMirroringDomain
If comments are being mirrored to an external site, this function returns the domain of that external site.- Returns:
- If comments are being mirrored to an external site, this function returns the domain of that external site.
-
setCommentsMirroringDomain
If comments are being mirrored to an external site, this function returns the domain of that external site. -
getMessage
The message.- Specified by:
getMessagein interfaceHasMessage- Returns:
- The message.
-
setMessage
The message. -
getParentId
ID of the parent post- Returns:
- ID of the parent post
-
setParentId
ID of the parent post -
getPermalinkUrl
The permanent static URL to the post on www.facebook.com.Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553
- Returns:
- The permanent static URL to the post on www.facebook.com.
-
setPermalinkUrl
The permanent static URL to the post on www.facebook.com.Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553
-
getPicture
If available, a link to the picture included with this post.- Returns:
- If available, a link to the picture included with this post.
-
setPicture
If available, a link to the picture included with this post. -
getLink
The link attached to this post. Hint for Graph API 3.3: Useattachment/url_unshimmedinstead- Returns:
- The link attached to this post.
-
setLink
The link attached to this post. Hint for Graph API 3.3: Useattachment/url_unshimmedinstead -
getName
The name of the link. Hint for Graph API 3.3: Useattachment/titleinstead- Returns:
- The name of the link.
-
setName
The name of the link. Hint for Graph API 3.3: Useattachment/titleinstead -
getCaption
The caption of the link (appears beneath the link name). Hint for Graph API 3.3: Useattachment/titleinstead- Returns:
- The caption of the link (appears beneath the link name).
-
setCaption
The caption of the link (appears beneath the link name). Hint for Graph API 3.3: Useattachment/titleinstead -
getDescription
A description of the link (appears beneath the link caption). Hint for Graph API 3.3: Useattachment/descriptioninstead- Returns:
- A description of the link (appears beneath the link caption).
-
setDescription
A description of the link (appears beneath the link caption). Hint for Graph API 3.3: Useattachment/descriptioninstead -
getEvent
If this Post has a place, the event associated with the place -
setEvent
If this Post has a place, the event associated with the place -
getExpandedHeight
-
setExpandedHeight
-
getHeight
-
setHeight
-
getExpandedWidth
-
setExpandedWidth
-
getWidth
-
setWidth
-
getVideoBuyingEligibility
-
setVideoBuyingEligibility
-
getSource
If available, the source link attached to this post (for example, a flash or video file). Hint for Graph API 3.3: Useattachment/media/sourceinstead- Returns:
- If available, the source link attached to this post (for example, a flash or video file).
-
setSource
If available, the source link attached to this post (for example, a flash or video file). Hint for Graph API 3.3: Useattachment/media/sourceinstead -
getApplication
The application used to create this post.- Returns:
- The application used to create this post.
-
setApplication
The application used to create this post. -
getIcon
A link to an icon representing the type of this post.- Returns:
- A link to an icon representing the type of this post.
-
setIcon
A link to an icon representing the type of this post. -
getPrivacy
The privacy settings for this post.- Returns:
- The privacy settings for this post.
-
setPrivacy
The privacy settings for this post. -
getPromotableId
ID of post to use for promotion for stories that cannot be promoted directly -
setPromotableId
ID of post to use for promotion for stories that cannot be promoted directly -
getPromotionStatus
Status of the promotion, if the post was promoted.- Returns:
- Status of the promotion, if the post was promoted
-
setPromotionStatus
Status of the promotion, if the post was promoted. -
getFeedTargeting
Object that controls news feed targeting for this post. To force Facebook to fill thefeed_targetingfield you have to fetch the post with thefields=feed_targetingparameter, otherwise the feedTargeting isnull.- Since:
- 1.11.0
-
setFeedTargeting
Object that controls news feed targeting for this post. To force Facebook to fill thefeed_targetingfield you have to fetch the post with thefields=feed_targetingparameter, otherwise the feedTargeting isnull.- Since:
- 1.11.0
-
getCanReplyPrivately
Whether the viewer can send a private reply to this post (Page viewers only)- Returns:
- Whether the viewer can send a private reply to this post
-
setCanReplyPrivately
Whether the viewer can send a private reply to this post (Page viewers only) -
getTarget
The profile this was posted on if different from the author.- Returns:
- The profile this was posted on if different from the author
-
setTarget
The profile this was posted on if different from the author. -
getTargeting
Ads targeting information of the post.- Returns:
- Ads targeting information of the post
-
setTargeting
Ads targeting information of the post. -
getTimelineVisibility
Timeline visibility information of the post.- Returns:
- timeline visibility information of the post
-
setTimelineVisibility
Timeline visibility information of the post. -
getLikes
Duplicate mapping for "likes" since FB can return it differently in different situations. -- GETTER -- The likes on this post.Sometimes this can be
null- checkgetLikesCount()instead in that case.- Returns:
- The likes on this post.
-
setLikes
Duplicate mapping for "likes" since FB can return it differently in different situations. -- GETTER -- The likes on this post.Sometimes this can be
null- checkgetLikesCount()instead in that case. -
getCreatedTime
The time the post was initially published.- Specified by:
getCreatedTimein interfaceHasCreatedTime- Returns:
- The time the post was initially published.
-
setCreatedTime
The time the post was initially published. -
getUpdatedTime
The time of the last comment on this post.- Returns:
- The time of the last comment on this post.
-
setUpdatedTime
The time of the last comment on this post. -
getTaggedTime
This field is available on tagged Posts.- Returns:
- The tagging Date of the Post
-
setTaggedTime
This field is available on tagged Posts. -
getObjectId
The Facebook object id for an uploaded photo or video. Hint for Graph API 3.3: Useattachment/target/idinstead- Returns:
- The Facebook object id for an uploaded photo or video.
- Since:
- 1.6.5
-
setObjectId
The Facebook object id for an uploaded photo or video. Hint for Graph API 3.3: Useattachment/target/idinstead- Since:
- 1.6.5
-
getStatusType
Thestatus_typeof post this is, for example"approved_friend".- Returns:
- The
status_typeof post this is, for example"approved_friend". - Since:
- 1.6.12
-
setStatusType
Thestatus_typeof post this is, for example"approved_friend".- Since:
- 1.6.12
-
getStory
Text from stories not intentionally generated by users- Returns:
- Text from stories not intentionally generated by users
- Since:
- 1.6.16
-
setStory
Text from stories not intentionally generated by users- Since:
- 1.6.16
-
getComments
The comments for this post.- Specified by:
getCommentsin interfaceHasComments- Returns:
- The comments for this post.
-
setComments
The comments for this post. -
getReactions
The reactions for this post.- Returns:
- The reactions for this post.
-
setReactions
The reactions for this post. -
getPlace
The place where this post occurred.- Returns:
- The place where this post occurred.
- Since:
- 1.6.8
-
setPlace
The place where this post occurred.- Since:
- 1.6.8
-
getInsights
-
setInsights
-
getScheduledPublishTime
UNIX timestamp of the scheduled publish time for the post.- Returns:
- UNIX timestamp of the scheduled publish time for the post
-
setScheduledPublishTime
UNIX timestamp of the scheduled publish time for the post. -
getAdminCreator
ID of admin who created the post. Applies to pages only- Returns:
- ID of admin who created the post.
- Since:
- 1.10.0
-
setAdminCreator
ID of admin who created the post. Applies to pages only- Since:
- 1.10.0
-
getInstagramEligibility
Whether the post can be promoted on Instagram.It returns the enum
eligibleif it can be promoted. Otherwise it returns an enum for why it cannot be promoted- Returns:
- Whether the post can be promoted on Instagram
-
setInstagramEligibility
Whether the post can be promoted on Instagram.It returns the enum
eligibleif it can be promoted. Otherwise it returns an enum for why it cannot be promoted -
getIsEligibleForPromotion
-
setIsEligibleForPromotion
-
getIsExpired
Whether the post has expiration time that has passed- Returns:
- Whether the post has expiration time that has passed
-
setIsExpired
Whether the post has expiration time that has passed -
getIsHidden
If this post is marked as hidden (applies to Pages only).- Returns:
- if this post is marked as hidden
- Since:
- 1.10.0
-
setIsHidden
If this post is marked as hidden (applies to Pages only).- Since:
- 1.10.0
-
getIsInlineCreated
Returns True if the post was created inline when creating ads. -
setIsInlineCreated
Returns True if the post was created inline when creating ads. -
getIsInstagramEligible
Whether this post can be promoted in Instagram.- Returns:
- Whether this post can be promoted in Instagram
-
setIsInstagramEligible
Whether this post can be promoted in Instagram. -
getIsPopular
Whether the post is currently popular. Based on whether the total actions as a percentage of reach exceeds a certain threshold- Returns:
- Whether the post is currently popular
-
setIsPopular
Whether the post is currently popular. Based on whether the total actions as a percentage of reach exceeds a certain threshold -
getIsPublished
Indicates whether a scheduled post was published. (applies to scheduled Page Post only, for users post and instantly published posts this value is alwaystrue)- Returns:
- indicates whether a scheduled post was published
- Since:
- 1.10.0
-
setIsPublished
Indicates whether a scheduled post was published. (applies to scheduled Page Post only, for users post and instantly published posts this value is alwaystrue)- Since:
- 1.10.0
-
getIsSpherical
Whether the post is a spherical video post.- Returns:
- Whether the post is a spherical video post
-
setIsSpherical
Whether the post is a spherical video post. -
getAttachments
Attachments added to a post. To force Facebook to fill theattachmentsfield you have to fetch the post with thefields=attachmentsparameter, otherwise the attachments arenull.- Returns:
- Attachment on the post
-
setAttachments
Attachments added to a post. To force Facebook to fill theattachmentsfield you have to fetch the post with thefields=attachmentsparameter, otherwise the attachments arenull. -
getFullPicture
Full picture URL. you get the url to this posts full picture. To force Facebook to fill thefull_picturefield you have to fetch the post with thefields=full_pictureparameter, otherwise the full_picture isnull.- Returns:
- String representing the url to the post's full picture
-
setFullPicture
Full picture URL. you get the url to this posts full picture. To force Facebook to fill thefull_picturefield you have to fetch the post with thefields=full_pictureparameter, otherwise the full_picture isnull. -
getVia
ID of the user or Page the post was shared from -
setVia
ID of the user or Page the post was shared from
-