com.sola.instagram.model
Class Media

java.lang.Object
  extended by com.sola.instagram.model.InstagramModel
      extended by com.sola.instagram.model.Media

public class Media
extends InstagramModel

Object for a piece of Media with the JSON representation

{
                        "attribution":null,
                        "tags":["", ""],
                        "type":"image",
                        "location":null,
                        "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":""
                        }
 }

Version:
2012-08-22
Author:
Sola Ogunsakin

Nested Class Summary
 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
 
Constructor Summary
Media(org.json.JSONObject obj, java.lang.String accessToken)
          Makes a new Media object out of a JSONObject
 
Method Summary
 Media.Caption getCaption()
          Returns the Caption object representing this media's caption
 java.util.List<Comment> getComments()
          Lazy-loads and returns a list of comments for this media
 java.lang.String getCreatedTimestamp()
          Returns this media's creation timestamp a string
 java.lang.String getFilter()
          Returns the type filter for this media's image
 java.lang.String getId()
          Returns the id of this media
 java.util.List<User> getLikers()
          Lazy-Loads and returns a list of users who have liked this media
 java.lang.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
 java.util.List<java.lang.String> getTags()
          Returns a list of tags (as strings) used in this media
 Media.Image getThumbnailImage()
          Returns the thumbnail image for this media
 java.lang.String getType()
          Returns the type of this media
 User getUser()
          Returns the User object of this media's creator
 java.lang.Boolean userHasLikedMedia()
          Indicated whether the current user has liked this media
 
Methods inherited from class com.sola.instagram.model.InstagramModel
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Media

public Media(org.json.JSONObject obj,
             java.lang.String accessToken)
      throws InstagramException
Makes a new Media object out of a JSONObject

Parameters:
obj - json object used to create this media
accessToken - API access token used for lazyloaded api requests
Throws:
InstagramException
Method Detail

getType

public java.lang.String getType()
Returns the type of this media

Returns:
The type of this media

getFilter

public java.lang.String getFilter()
Returns the type filter for this media's image

Returns:
The type filter for this media's image

getCaption

public Media.Caption getCaption()
Returns the Caption object representing this media's caption

Returns:
The Caption object representing this media's caption

getLink

public java.lang.String getLink()
Returns the url link to this media

Returns:
The url link to this media

getComments

public java.util.List<Comment> getComments()
                                    throws InstagramException
Lazy-loads and returns a list of comments for this media

Returns:
A list of lazy-loaded comments for this media
Throws:
InstagramException

getUser

public User getUser()
Returns the User object of this media's creator

Returns:
The User object of this media's creator

getLocation

public Location getLocation()
Returns the Location object representing location that this media was created

Returns:
Location object representing location that this media was created

userHasLikedMedia

public java.lang.Boolean userHasLikedMedia()
Indicated whether the current user has liked this media

Returns:
a boolean indicating whether the current user has liked this media

getCreatedTimestamp

public java.lang.String getCreatedTimestamp()
Returns this media's creation timestamp a string

Returns:
This media's creation timestamp a string

getId

public java.lang.String getId()
Returns the id of this media

Returns:
The id of this media

getLowResolutionImage

public Media.Image getLowResolutionImage()
Returns the low resolution image for this media

Returns:
The low resolution image for this media

getThumbnailImage

public Media.Image getThumbnailImage()
Returns the thumbnail image for this media

Returns:
The thumbnail image for this media

getStandardResolutionImage

public Media.Image getStandardResolutionImage()
Returns the standard resolution image for this media

Returns:
The standard resolution image for this media

getLikers

public java.util.List<User> getLikers()
                               throws InstagramException
Lazy-Loads and returns a list of users who have liked this media

Returns:
A lazy-loaded list of users who have liked this media
Throws:
InstagramException

getTags

public java.util.List<java.lang.String> getTags()
Returns a list of tags (as strings) used in this media

Returns:
A list of tags (as strings) used in this media