public class Media extends InstagramModel
{ "attribution":null, "tags":["", ""], "type":"image", "location":null, "users_in_photo": [{ "user": { "username": "", "full_name": "", "id": "", "profile_picture": "" }, "position": { "x": 0, "y": 0 } }], "comments": { "count":0, "data":[ { "username":"", "profile_picture":"", "id":"", "full_name":"" } ] }, "filter":"", "created_time":"", "link":"", "likes": { "count": 0, "data":[ { "username":"", "profile_picture":"", "id":"", "full_name":"" } ], }, "images": { "low_resolution": { "url":"", "width":0, "height":0 }, "thumbnail": { "url":"", "width":0, "height":0 }, "standard_resolution":{ "url":"", "width":0,"height":0} }, "caption": { "created_time":"0", "text":"", "from": { "username":"", "profile_picture":"", "id":"", "full_name":"" }, "id":"" }, "user_has_liked":false, "id":"", "user": { "username":"", "website":"", "bio":"", "profile_picture":"", "full_name":"", "id":"" } }
Modifier and Type | Class and Description |
---|---|
class |
Media.Caption
Object for a media caption
with the JSON representation
|
static class |
Media.Filters
Types of image filters
|
class |
Media.Image
Object for a media image
with the JSON representation
|
class |
Media.UserPhotoTag
Object for a user photo tag
with the JSON representation
|
Modifier and Type | Field and Description |
---|---|
protected Media.Caption |
caption
Caption object representing this media's caption
|
protected int |
commentCount
Number of comments for this media
|
protected List<Comment> |
comments
List of lazyloaded Comment objects for this media
|
protected String |
createdTimestamp
The creation timestamp as a string
|
protected String |
filter
The image filter
|
protected String |
id
Id of this media as a string
|
protected int |
likeCount
Number of likes for this media
|
protected List<User> |
likers
List of lazyloaded User objects for users who
liked the media
|
protected String |
link
The link for this media
|
protected Location |
location
Location object representing where this media was created
|
protected Media.Image |
lowResolutionImage
Low resolution image version of the media's image
|
protected Media.Image |
standardResolutionImage
Standard resolution version of the media's image
|
protected List<String> |
tags
List of tags used in this media
|
protected Media.Image |
thumbnailImage
Thumbnail resolution image version of the media's image
|
protected String |
type
Type of Media
|
protected User |
user
User who created this media
|
protected Boolean |
userHasLikedMedia
Boolean indicating if the current user has liked this media
|
protected List<Media.UserPhotoTag> |
usersInPhoto
Users tagged in photo
|
Constructor and Description |
---|
Media(JSONObject obj,
String accessToken)
Makes a new Media object out of a JSONObject
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Checks if two media objects are equal
|
static Media |
fromJSON(JSONObject obj,
String accessToken) |
Media.Caption |
getCaption()
Returns the Caption object representing this media's caption
|
int |
getCommentCount()
Returns the number of comments for this media
|
List<Comment> |
getComments()
Lazy-loads and returns a list of comments for this media
|
String |
getCreatedTimestamp()
Returns this media's creation timestamp a string
|
String |
getFilter()
Returns the type filter for this media's image
|
String |
getId()
Returns the id of this media
|
int |
getLikeCount()
Returns the number of likes for this media
|
List<User> |
getLikers()
Lazy-Loads and returns a list of users who have liked this media
|
String |
getLink()
Returns the url link to this media
|
Location |
getLocation()
Returns the Location object representing location that this
media was created
|
Media.Image |
getLowResolutionImage()
Returns the low resolution image for this media
|
Media.Image |
getStandardResolutionImage()
Returns the standard resolution image for this media
|
List<String> |
getTags()
Returns a list of tags (as strings) used in this media
|
Media.Image |
getThumbnailImage()
Returns the thumbnail image for this media
|
String |
getType()
Returns the type of this media
|
User |
getUser()
Returns the User object of this media's creator
|
List<Media.UserPhotoTag> |
getUsersInPhoto()
Returns a list of tags (as strings) used in this media
|
protected void |
setCaption(Media.Caption caption) |
protected void |
setComments(List<Comment> comments) |
protected void |
setCreatedTimestamp(String createdTimestamp) |
protected void |
setFilter(String filter) |
protected void |
setId(String id) |
protected void |
setLikers(List<User> likers) |
protected void |
setLink(String link) |
protected void |
setLocation(Location location) |
protected void |
setLowResolutionImage(Media.Image lowResolutionImage) |
protected void |
setStandardResolutionImage(Media.Image standardResolutionImage) |
protected void |
setTags(List<String> tags) |
protected void |
setThumbnailImage(Media.Image thumbnailImage) |
protected void |
setType(String type) |
protected void |
setUser(User user) |
protected void |
setUserHasLikedMedia(Boolean userHasLikedMedia) |
protected void |
setUsersInPhoto(List<Media.UserPhotoTag> users) |
Boolean |
userHasLikedMedia()
Indicated whether the current user has liked this media
|
getAccessToken, setAccessToken, toString
protected String type
protected String filter
protected String link
protected Media.Image lowResolutionImage
protected Media.Image thumbnailImage
protected Media.Image standardResolutionImage
protected User user
protected Location location
protected String createdTimestamp
protected String id
protected Media.Caption caption
protected Boolean userHasLikedMedia
protected List<Media.UserPhotoTag> usersInPhoto
protected int likeCount
protected int commentCount
public Media(JSONObject obj, String accessToken) throws JSONException
obj
- json object used to create this mediaaccessToken
- API access token used for lazyloaded api requestsJSONException
public static Media fromJSON(JSONObject obj, String accessToken) throws JSONException
JSONException
public String getType()
protected void setType(String type)
public String getFilter()
protected void setFilter(String filter)
public int getLikeCount()
public int getCommentCount()
public Media.Caption getCaption()
public String getLink()
protected void setLink(String link)
public List<Comment> getComments() throws Exception
Exception
public User getUser()
protected void setUser(User user)
public Location getLocation()
protected void setLocation(Location location)
public Boolean userHasLikedMedia()
protected void setUserHasLikedMedia(Boolean userHasLikedMedia)
public String getCreatedTimestamp()
protected void setCreatedTimestamp(String createdTimestamp)
public String getId()
protected void setId(String id)
public Media.Image getLowResolutionImage()
protected void setLowResolutionImage(Media.Image lowResolutionImage)
public Media.Image getThumbnailImage()
protected void setThumbnailImage(Media.Image thumbnailImage)
public Media.Image getStandardResolutionImage()
protected void setStandardResolutionImage(Media.Image standardResolutionImage)
protected void setCaption(Media.Caption caption)
public List<User> getLikers() throws Exception
Exception
public List<String> getTags()
public List<Media.UserPhotoTag> getUsersInPhoto()
protected void setUsersInPhoto(List<Media.UserPhotoTag> users)
Copyright © 2013. All Rights Reserved.