Package com.restfb.types
Class Photo
- java.lang.Object
-
- com.restfb.types.AbstractFacebookType
-
- com.restfb.types.FacebookType
-
- com.restfb.types.NamedFacebookType
-
- com.restfb.types.Photo
-
- All Implemented Interfaces:
HasComments
,HasCreatedTime
,Serializable
public class Photo extends NamedFacebookType implements HasComments, HasCreatedTime
Represents the Photo Graph API type.- Since:
- 1.5
- Author:
- Mark Allen
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Photo.Image
Represents the Image Graph API type.static class
Photo.Tag
Represents the Tag Graph API type.-
Nested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata
-
-
Constructor Summary
Constructors Constructor Description Photo()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addImage(Photo.Image image)
boolean
addNameTag(EntityAtTextRange nameTag)
boolean
addTag(Photo.Tag tag)
Album
getAlbum()
The album this photo is inDate
getBackdatedTime()
Back dated timeString
getBackdatedTimeGranularity()
String that represents the back dated time granularityBoolean
getCanDelete()
A boolean indicating if the viewer can delete the photoBoolean
getCanTag()
A boolean indicating if the viewer can tag the photoComments
getComments()
All of the comments on this photo.Date
getCreatedTime()
The time the photo was initially published.Event
getEvent()
If this object has a place, the event associated with the placeFrom
getFrom()
An object containing the name and ID of the user who posted the photo.Integer
getHeight()
The height of the photo, in pixels.String
getIcon()
The icon-sized source of the photo.List<Photo.Image>
getImages()
The 4 different stored representations of the photo.Connection<Insight>
getInsights()
Likes
getLikes()
String
getLink()
A link to the photo on Facebook.List<EntityAtTextRange>
getNameTags()
String
getPageStoryId()
ID of the page story this corresponds to.String
getPicture()
The album-sized view of the photo.Place
getPlace()
The location associated with this photo, if any.Integer
getPosition()
Deprecated.Facebook will start returning 0 for this field starting on October 3, 2012.Reactions
getReactions()
The reactions for this photo.String
getSource()
Deprecated.Useimages
field insteadList<Photo.Tag>
getTags()
An array containing the users and their positions in this photo.Date
getUpdatedTime()
The last time the photo or its caption was updated.Integer
getWidth()
The width of the photo, in pixels.protected void
jsonMappingCompleted(JsonMapper jsonMapper)
Post-JSON-mapping operation that populates themessageTags
field "by hand".boolean
removeImage(Photo.Image image)
boolean
removeNameTag(EntityAtTextRange nameTag)
boolean
removeTag(Photo.Tag tag)
void
setAlbum(Album album)
The album this photo is invoid
setBackdatedTime(Date backdatedTime)
Back dated timevoid
setBackdatedTimeGranularity(String backdatedTimeGranularity)
String that represents the back dated time granularityvoid
setCanDelete(Boolean canDelete)
A boolean indicating if the viewer can delete the photovoid
setCanTag(Boolean canTag)
A boolean indicating if the viewer can tag the photovoid
setComments(Comments comments)
All of the comments on this photo.void
setCreatedTime(Date createdTime)
The time the photo was initially published.void
setEvent(Event event)
If this object has a place, the event associated with the placevoid
setFrom(From from)
An object containing the name and ID of the user who posted the photo.void
setHeight(Integer height)
The height of the photo, in pixels.void
setIcon(String icon)
The icon-sized source of the photo.void
setInsights(Connection<Insight> insights)
void
setLikes(Likes likes)
void
setLink(String link)
A link to the photo on Facebook.void
setPageStoryId(String pageStoryId)
ID of the page story this corresponds to.void
setPicture(String picture)
The album-sized view of the photo.void
setPlace(Place place)
The location associated with this photo, if any.void
setPosition(Integer position)
Deprecated.Facebook will start returning 0 for this field starting on October 3, 2012.void
setReactions(Reactions reactions)
The reactions for this photo.void
setSource(String source)
Deprecated.Useimages
field insteadvoid
setUpdatedTime(Date updatedTime)
The last time the photo or its caption was updated.void
setWidth(Integer width)
The width of the photo, in pixels.-
Methods inherited from class com.restfb.types.NamedFacebookType
getName, setName
-
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
-
Photo
public Photo()
-
-
Method Detail
-
getTags
public List<Photo.Tag> getTags()
An array containing the users and their positions in this photo. The x and y coordinates are percentages from the left and top edges of the photo, respectively.- Returns:
- An array containing the users and their positions in this photo. The x and y coordinates are percentages from the left and top edges of the photo, respectively.
-
getNameTags
public List<EntityAtTextRange> getNameTags()
-
addNameTag
public boolean addNameTag(EntityAtTextRange nameTag)
-
removeNameTag
public boolean removeNameTag(EntityAtTextRange nameTag)
-
getImages
public List<Photo.Image> getImages()
The 4 different stored representations of the photo.- Returns:
- The 4 different stored representations of the photo.
- Since:
- 1.6.5
-
addImage
public boolean addImage(Photo.Image image)
-
removeImage
public boolean removeImage(Photo.Image image)
-
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.
-
getFrom
public From getFrom()
An object containing the name and ID of the user who posted the photo.- Returns:
- An object containing the name and ID of the user who posted the photo.
-
setFrom
public void setFrom(From from)
An object containing the name and ID of the user who posted the photo.
-
getPicture
public String getPicture()
The album-sized view of the photo.- Returns:
- The album-sized view of the photo.
-
setPicture
public void setPicture(String picture)
The album-sized view of the photo.
-
getPageStoryId
public String getPageStoryId()
ID of the page story this corresponds to. May not be on all photos. Applies only to published photos- Returns:
- ID of the page story this corresponds to.
-
setPageStoryId
public void setPageStoryId(String pageStoryId)
ID of the page story this corresponds to. May not be on all photos. Applies only to published photos
-
getReactions
public Reactions getReactions()
The reactions for this photo.- Returns:
- The reactions for this photo.
-
setReactions
public void setReactions(Reactions reactions)
The reactions for this photo.
-
getSource
@Deprecated public String getSource()
Deprecated.Useimages
field insteadThe full-sized source of the photo.- Returns:
- The full-sized source of the photo.
-
setSource
@Deprecated public void setSource(String source)
Deprecated.Useimages
field insteadThe full-sized source of the photo.
-
getHeight
public Integer getHeight()
The height of the photo, in pixels.- Returns:
- The height of the photo, in pixels.
-
getWidth
public Integer getWidth()
The width of the photo, in pixels.- Returns:
- The width of the photo, in pixels.
-
getLink
public String getLink()
A link to the photo on Facebook.- Returns:
- A link to the photo on Facebook.
-
getIcon
public String getIcon()
The icon-sized source of the photo.- Returns:
- The icon-sized source of the photo.
-
getCanDelete
public Boolean getCanDelete()
A boolean indicating if the viewer can delete the photo- Returns:
- A boolean indicating if the viewer can delete the photo
-
setCanDelete
public void setCanDelete(Boolean canDelete)
A boolean indicating if the viewer can delete the photo
-
getCanTag
public Boolean getCanTag()
A boolean indicating if the viewer can tag the photo- Returns:
- A boolean indicating if the viewer can tag the photo
-
setCanTag
public void setCanTag(Boolean canTag)
A boolean indicating if the viewer can tag the photo
-
getPosition
@Deprecated public Integer getPosition()
Deprecated.Facebook will start returning 0 for this field starting on October 3, 2012.The position of this photo in the album.- Returns:
- The position of this photo in the album.
- Since:
- 1.6.5
-
setPosition
@Deprecated public void setPosition(Integer position)
Deprecated.Facebook will start returning 0 for this field starting on October 3, 2012.The position of this photo in the album.- Since:
- 1.6.5
-
getEvent
@GraphAPI(since="2.3") public Event getEvent()
If this object has a place, the event associated with the place- Returns:
- If this object has a place, the event associated with the place
-
setEvent
public void setEvent(Event event)
If this object has a place, the event associated with the place
-
getUpdatedTime
public Date getUpdatedTime()
The last time the photo or its caption was updated.- Returns:
- The last time the photo or its caption was updated.
-
setUpdatedTime
public void setUpdatedTime(Date updatedTime)
The last time the photo or its caption was updated.
-
getCreatedTime
public Date getCreatedTime()
The time the photo was initially published.- Specified by:
getCreatedTime
in interfaceHasCreatedTime
- Returns:
- The time the photo was initially published.
-
setCreatedTime
public void setCreatedTime(Date createdTime)
The time the photo was initially published.
-
getComments
public Comments getComments()
All of the comments on this photo.- Specified by:
getComments
in interfaceHasComments
- Returns:
- All of the comments on this photo.
- Since:
- 1.6.5
-
setComments
public void setComments(Comments comments)
All of the comments on this photo.- Since:
- 1.6.5
-
getPlace
public Place getPlace()
The location associated with this photo, if any.- Returns:
- The place this photo was taken.
- Since:
- 1.6.10
-
setPlace
public void setPlace(Place place)
The location associated with this photo, if any.- Since:
- 1.6.10
-
getBackdatedTime
public Date getBackdatedTime()
Back dated time- Returns:
- the back dated time
- Since:
- 1.6.15
-
setBackdatedTime
public void setBackdatedTime(Date backdatedTime)
Back dated time- Since:
- 1.6.15
-
getBackdatedTimeGranularity
public String getBackdatedTimeGranularity()
String that represents the back dated time granularity- Returns:
- the back dated time granularity
- Since:
- 1.6.15
-
setBackdatedTimeGranularity
public void setBackdatedTimeGranularity(String backdatedTimeGranularity)
String that represents the back dated time granularity- Since:
- 1.6.15
-
getInsights
public Connection<Insight> getInsights()
-
setInsights
public void setInsights(Connection<Insight> insights)
-
-