Package com.restfb.types
Class Message
- java.lang.Object
-
- com.restfb.types.AbstractFacebookType
-
- com.restfb.types.FacebookType
-
- com.restfb.types.Message
-
- All Implemented Interfaces:
HasCreatedTime
,HasFrom
,HasMessage
,Serializable
public class Message extends FacebookType implements HasCreatedTime, HasFrom, HasMessage
Represents the Message Graph API type .- Author:
- Mark Allen, Felipe Kurkowski, alockhart
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Message.Attachment
Represents an attached file that you may find on a private message.static class
Message.AttachmentData
static class
Message.ImageData
Additional attachment information, only present when an attached file is an image.static class
Message.Reaction
static class
Message.Share
Represents the Message Share Graph API type.static class
Message.Story
static class
Message.StoryMention
static class
Message.StoryReply
static class
Message.VideoData
Additional attachment information, only present when an attached file is a video.-
Nested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata
-
-
Constructor Summary
Constructors Constructor Description Message()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAttachment(Message.Attachment attachment)
boolean
addReaction(Message.Reaction reaction)
boolean
addShare(Message.Share share)
boolean
addTag(String tag)
boolean
addTo(ExtendedReferenceType receiver)
List<Message.Attachment>
getAttachments()
The attachments associated with the message.Date
getCreatedTime()
The time the message was initially created.ExtendedReferenceType
getFrom()
The sender of this messageString
getMessage()
The text of the messageList<Message.Reaction>
getReactions()
Reaction (like/love) on the existing messageList<Message.Share>
getShares()
The shares associated with the message.String
getSticker()
Sticker contained in the message.Message.Story
getStory()
String
getSubject()
The subject of the message.List<String>
getTags()
A set of tags indicating the message folder and source of the message.List<ExtendedReferenceType>
getTo()
A list of recipients of the message.Integer
getUnread()
The "unread" count for this message.Boolean
getUnseen()
Whether this message has been seen.Date
getUpdatedTime()
The time of the last update to this message.boolean
isUnsupported()
boolean
removeAttachment(Message.Attachment attachment)
boolean
removeReaction(Message.Reaction reaction)
boolean
removeShare(Message.Share share)
boolean
removeTag(String tag)
boolean
removeTo(ExtendedReferenceType receiver)
void
setCreatedTime(Date createdTime)
The time the message was initially created.void
setFrom(ExtendedReferenceType from)
The sender of this messagevoid
setMessage(String message)
The text of the messagevoid
setSticker(String sticker)
Sticker contained in the message.void
setStory(Message.Story story)
void
setSubject(String subject)
The subject of the message.void
setUnread(Integer unread)
The "unread" count for this message.void
setUnseen(Boolean unseen)
Whether this message has been seen.void
setUnsupported(boolean isUnsupported)
void
setUpdatedTime(Date updatedTime)
The time of the last update to this message.-
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
-
Message
public Message()
-
-
Method Detail
-
getAttachments
public List<Message.Attachment> getAttachments()
The attachments associated with the message.- Returns:
- The attachments associated with the message.
-
addAttachment
public boolean addAttachment(Message.Attachment attachment)
-
removeAttachment
public boolean removeAttachment(Message.Attachment attachment)
-
getShares
public List<Message.Share> getShares()
The shares associated with the message.This is page only.
- Returns:
- The shares associated with the message.
-
addShare
public boolean addShare(Message.Share share)
-
removeShare
public boolean removeShare(Message.Share share)
-
getTo
public List<ExtendedReferenceType> getTo()
A list of recipients of the message.- Returns:
- A list of the message recipients
-
addTo
public boolean addTo(ExtendedReferenceType receiver)
-
removeTo
public boolean removeTo(ExtendedReferenceType receiver)
-
getTags
public List<String> getTags()
A set of tags indicating the message folder and source of the message.- Returns:
- A set of tags indicating the message folder and source of the message.
-
getReactions
public List<Message.Reaction> getReactions()
Reaction (like/love) on the existing message- Returns:
- list of reactions
-
addReaction
public boolean addReaction(Message.Reaction reaction)
-
removeReaction
public boolean removeReaction(Message.Reaction reaction)
-
getCreatedTime
public Date getCreatedTime()
The time the message was initially created.- Specified by:
getCreatedTime
in interfaceHasCreatedTime
- Returns:
- The time the message was initially created.
-
setCreatedTime
public void setCreatedTime(Date createdTime)
The time the message was initially created.
-
getSubject
public String getSubject()
The subject of the message.- Returns:
- The subject of the message.
-
setSubject
public void setSubject(String subject)
The subject of the message.
-
getFrom
public ExtendedReferenceType getFrom()
The sender of this message
-
setFrom
public void setFrom(ExtendedReferenceType from)
The sender of this message
-
isUnsupported
public boolean isUnsupported()
-
setUnsupported
public void setUnsupported(boolean isUnsupported)
-
getMessage
public String getMessage()
The text of the message- Specified by:
getMessage
in interfaceHasMessage
- Returns:
- The text of the message
-
setMessage
public void setMessage(String message)
The text of the message
-
getSticker
public String getSticker()
Sticker contained in the message.- Returns:
- The Sticker in that message
-
setSticker
public void setSticker(String sticker)
Sticker contained in the message.
-
getStory
public Message.Story getStory()
-
setStory
public void setStory(Message.Story story)
-
getUpdatedTime
public Date getUpdatedTime()
The time of the last update to this message.- Returns:
- The time of the last update to this message.
-
setUpdatedTime
public void setUpdatedTime(Date updatedTime)
The time of the last update to this message.
-
getUnread
public Integer getUnread()
The "unread" count for this message.- Returns:
- The "unread" count for this message.
-
getUnseen
public Boolean getUnseen()
Whether this message has been seen.- Returns:
- Whether this message has been seen.
-
-