Package com.restfb.types
Class Comment
- java.lang.Object
-
- com.restfb.types.AbstractFacebookType
-
- com.restfb.types.FacebookType
-
- com.restfb.types.Comment
-
- All Implemented Interfaces:
HasComments
,HasCreatedTime
,HasMessage
,Serializable
public class Comment extends FacebookType implements HasComments, HasCreatedTime, HasMessage
Represents the Comment Graph API type.- Since:
- 1.5
- Author:
- Mark Allen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata
-
-
Constructor Summary
Constructors Constructor Description Comment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageTag(MessageTag messageTag)
StoryAttachment
getAttachment()
Attachment (image) added to a comment.Boolean
getCanComment()
Specifies whether you can reply to this commentBoolean
getCanHide()
Whether the viewer can hide this commentBoolean
getCanLike()
Whether the viewer can like this commentBoolean
getCanRemove()
This field is returned only if the authenticated user can remove this comment.Boolean
getCanReplyPrivately()
Whether the viewer can send a private reply to this comment (Page viewers only)long
getCommentCount()
Number of replies to this comment.Comments
getComments()
The replies to this commentDate
getCreatedTime()
Date on which the comment was created.From
getFrom()
User who posted the comment.Boolean
getIsHidden()
Whether this comment is hidden.Long
getLikeCount()
The number of likes on this comment.Likes
getLikes()
Duplicate mapping for "likes" since FB can return it differently in different situations.String
getMessage()
Text contents of the comment.List<MessageTag>
getMessageTags()
Objects tagged in the message (Users, Pages, etc.)NamedFacebookType
getObject()
Parent object this comment was made on.Comment
getParent()
If this comment is a reply, this field returns the parent comment, otherwise no valueString
getPermalinkUrl()
The permanent static URL to the commentConversation
getPrivateReplyConversation()
For comments with private replies, gets conversation between the Page and author of the comment (Page viewers only)Reactions
getReactions()
The reactions for this post.Boolean
getUserLikes()
This field is returned only if the authenticated user likes this commentprotected void
jsonMappingCompleted(JsonMapper jsonMapper)
Post-JSON-mapping operation that populates themessageTags
field "by hand".void
removeMessageTag(MessageTag messageTag)
void
setAttachment(StoryAttachment attachment)
Attachment (image) added to a comment.void
setCanComment(Boolean canComment)
Specifies whether you can reply to this commentvoid
setCanHide(Boolean canHide)
Whether the viewer can hide this commentvoid
setCanLike(Boolean canLike)
Whether the viewer can like this commentvoid
setCanRemove(Boolean canRemove)
This field is returned only if the authenticated user can remove this comment.void
setCanReplyPrivately(Boolean canReplyPrivately)
Whether the viewer can send a private reply to this comment (Page viewers only)void
setCommentCount(long commentCount)
Number of replies to this comment.void
setComments(Comments comments)
The replies to this commentvoid
setCreatedTime(Date createdTime)
Date on which the comment was created.void
setFrom(From from)
User who posted the comment.void
setIsHidden(Boolean isHidden)
Whether this comment is hidden.void
setLikeCount(Long likeCount)
The number of likes on this comment.void
setLikes(Likes likes)
Duplicate mapping for "likes" since FB can return it differently in different situations.void
setMessage(String message)
Text contents of the comment.void
setObject(NamedFacebookType object)
Parent object this comment was made on.void
setParent(Comment parent)
If this comment is a reply, this field returns the parent comment, otherwise no valuevoid
setPermalinkUrl(String permalinkUrl)
The permanent static URL to the commentvoid
setPrivateReplyConversation(Conversation privateReplyConversation)
For comments with private replies, gets conversation between the Page and author of the comment (Page viewers only)void
setReactions(Reactions reactions)
The reactions for this post.void
setUserLikes(Boolean userLikes)
This field is returned only if the authenticated user likes this comment-
Methods inherited from class com.restfb.types.FacebookType
getId, getMetadata, getType, setId, setMetadata, setType
-
Methods inherited from class com.restfb.types.AbstractFacebookType
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
Comment
public Comment()
-
-
Method Detail
-
jsonMappingCompleted
protected void jsonMappingCompleted(JsonMapper jsonMapper)
Post-JSON-mapping operation that populates themessageTags
field "by hand".- Parameters:
jsonMapper
- TheJsonMapper
that was used to map to this type.
-
getMessageTags
public List<MessageTag> getMessageTags()
Objects tagged in the message (Users, Pages, etc.)- Returns:
- Objects tagged in the message (Users, Pages, etc.)
- Since:
- 1.6.10
-
addMessageTag
public void addMessageTag(MessageTag messageTag)
-
removeMessageTag
public void removeMessageTag(MessageTag messageTag)
-
getMessage
public String getMessage()
Text contents of the comment.- Specified by:
getMessage
in interfaceHasMessage
- Returns:
- Text contents of the comment.
-
setMessage
public void setMessage(String message)
Text contents of the comment.
-
getCreatedTime
public Date getCreatedTime()
Date on which the comment was created.- Specified by:
getCreatedTime
in interfaceHasCreatedTime
- Returns:
- Date on which the comment was created.
-
setCreatedTime
public void setCreatedTime(Date createdTime)
Date on which the comment was created.
-
getLikes
public Likes 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
- checkgetLikeCount()
instead in that case.- Returns:
- The likes on this comment.
-
setLikes
public void setLikes(Likes likes)
Duplicate mapping for "likes" since FB can return it differently in different situations.-- GETTER -- The likes on this post.
Sometimes this can be
null
- checkgetLikeCount()
instead in that case.
-
getReactions
public Reactions getReactions()
The reactions for this post.- Returns:
- The reactions for this post.
-
setReactions
public void setReactions(Reactions reactions)
The reactions for this post.
-
getLikeCount
public Long getLikeCount()
The number of likes on this comment.- Returns:
- The number of likes on this comment.
- Since:
- 1.6.10
-
setLikeCount
public void setLikeCount(Long likeCount)
The number of likes on this comment.- Since:
- 1.6.10
-
getCommentCount
public long getCommentCount()
Number of replies to this comment.- Returns:
- Number of replies to this comment
-
setCommentCount
public void setCommentCount(long commentCount)
Number of replies to this comment.
-
getCanRemove
public Boolean getCanRemove()
This field is returned only if the authenticated user can remove this comment.- Returns:
- This field is returned only if the authenticated user can remove this comment.
- Since:
- 1.6.10
-
setCanRemove
public void setCanRemove(Boolean canRemove)
This field is returned only if the authenticated user can remove this comment.- Since:
- 1.6.10
-
getUserLikes
public Boolean getUserLikes()
This field is returned only if the authenticated user likes this comment- Returns:
- This field is returned only if the authenticated user likes this comment.
- Since:
- 1.6.10
-
setUserLikes
public void setUserLikes(Boolean userLikes)
This field is returned only if the authenticated user likes this comment- Since:
- 1.6.10
-
getParent
public Comment getParent()
If this comment is a reply, this field returns the parent comment, otherwise no value- Returns:
- the parent Comment
- Since:
- 1.6.13
-
setParent
public void setParent(Comment parent)
If this comment is a reply, this field returns the parent comment, otherwise no value- Since:
- 1.6.13
-
getCanComment
public Boolean getCanComment()
Specifies whether you can reply to this comment- Returns:
- can_comment
- Since:
- 1.6.13
-
setCanComment
public void setCanComment(Boolean canComment)
Specifies whether you can reply to this comment- Since:
- 1.6.13
-
getCanHide
public Boolean getCanHide()
Whether the viewer can hide this comment- Returns:
- can_hide
- Since:
- 1.7.1
-
setCanHide
public void setCanHide(Boolean canHide)
Whether the viewer can hide this comment- Since:
- 1.7.1
-
getCanReplyPrivately
@GraphAPI(since="2.5") public Boolean getCanReplyPrivately()
Whether the viewer can send a private reply to this comment (Page viewers only)- Returns:
- Whether the viewer can send a private reply to this comment
-
setCanReplyPrivately
public void setCanReplyPrivately(Boolean canReplyPrivately)
Whether the viewer can send a private reply to this comment (Page viewers only)
-
getPrivateReplyConversation
@GraphAPI(since="2.5") public Conversation getPrivateReplyConversation()
For comments with private replies, gets conversation between the Page and author of the comment (Page viewers only)- Returns:
- conversation between Page and author of the comment
-
setPrivateReplyConversation
public void setPrivateReplyConversation(Conversation privateReplyConversation)
For comments with private replies, gets conversation between the Page and author of the comment (Page viewers only)
-
getIsHidden
public Boolean getIsHidden()
Whether this comment is hidden. The original poster can still see the comment, along with the page admin and anyone else tagged in the comment- Returns:
- is_hidden
- Since:
- 1.7.1
-
setIsHidden
public void setIsHidden(Boolean isHidden)
Whether this comment is hidden. The original poster can still see the comment, along with the page admin and anyone else tagged in the comment- Since:
- 1.7.1
-
getCanLike
public Boolean getCanLike()
Whether the viewer can like this comment- Returns:
- can_like
-
setCanLike
public void setCanLike(Boolean canLike)
Whether the viewer can like this comment
-
getObject
public NamedFacebookType getObject()
Parent object this comment was made on.- Returns:
- object
- Since:
- 1.7.1
-
setObject
public void setObject(NamedFacebookType object)
Parent object this comment was made on.- Since:
- 1.7.1
-
getPermalinkUrl
public String getPermalinkUrl()
The permanent static URL to the comment- Returns:
- permanent static url
-
setPermalinkUrl
public void setPermalinkUrl(String permalinkUrl)
The permanent static URL to the comment
-
getComments
public Comments getComments()
The replies to this comment- Specified by:
getComments
in interfaceHasComments
- Returns:
- replies
-
setComments
public void setComments(Comments comments)
The replies to this comment
-
getAttachment
public StoryAttachment getAttachment()
Attachment (image) added to a comment.To force Facebook to fill the
attachment
field you have to fetch the comment with thefields=attachment
parameter, otherwise the attachments arenull
.- Returns:
- Attachment on the comment
-
setAttachment
public void setAttachment(StoryAttachment attachment)
Attachment (image) added to a comment.To force Facebook to fill the
attachment
field you have to fetch the comment with thefields=attachment
parameter, otherwise the attachments arenull
.
-
-