com.tumblr.jumblr.types
Class Post

java.lang.Object
  extended by com.tumblr.jumblr.types.Resource
      extended by com.tumblr.jumblr.types.Post
Direct Known Subclasses:
AnswerPost, AudioPost, ChatPost, LinkPost, PhotoPost, QuotePost, TextPost, UnknownTypePost, VideoPost

public class Post
extends Resource

This class is the base of all post types on Tumblr

Author:
jc

Field Summary
 
Fields inherited from class com.tumblr.jumblr.types.Resource
client
 
Constructor Summary
Post()
           
 
Method Summary
 void addTag(String tag)
          Add a tag
 void delete()
          Delete this post
protected  Map<String,Object> detail()
          Detail for this post
 String getBlogName()
          Get the blog name
 String getDateGMT()
          Get date of this post as String
 String getFormat()
          Get the format for this post
 Long getId()
          Get this post's ID
 String getPostUrl()
          Get the post URL for this post
 Long getRebloggedFromId()
          Get the ID of the post that this post reblogged
 String getRebloggedFromName()
          Get name of the blog that this post reblogged
 String getReblogKey()
          Get the reblog key
 String getSourceUrl()
          Get the source title for this post
 String getState()
          Get the current state for this post
 List<String> getTags()
          Get a list of the tags for this post
 Long getTimestamp()
          Get the timestamp of this post
 String getType()
          Get the type of this post
 Boolean isBookmarklet()
          Get whether or not this post was from the bookmarklet
 Boolean isLiked()
          Get whether or not this post is liked
 Boolean isMobile()
          Get whether or not this post was from mobile
 void like()
          Like this post
 Post reblog(String blogName)
           
 Post reblog(String blogName, Map<String,?> options)
          Reblog this post
 void removeTag(String tag)
          Remove a tag
 void save()
          Save this post
 void setBlogName(String blogName)
          Set the blog name for this post
 void setDate(Date date)
          Set the date as a date
 void setDate(String dateString)
          Set the data as a string
 void setFormat(String format)
          Set the format
 void setId(long id)
          Set the id for this post
 void setSlug(String slug)
          Set the slug
 void setState(String state)
          Set the state for this post
 void setTags(List<String> tags)
          Set the tags for this post
 String toString()
          Post toString
 void unlike()
          Unlike this post
 
Methods inherited from class com.tumblr.jumblr.types.Resource
getClient, setClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Post

public Post()
Method Detail

isLiked

public Boolean isLiked()
Get whether or not this post is liked

Returns:
boolean

getSourceUrl

public String getSourceUrl()
Get the source title for this post

Returns:
source title public String getSourceTitle() { return source_title; } /** Get the source URL for this post

isMobile

public Boolean isMobile()
Get whether or not this post was from mobile

Returns:
boolean

isBookmarklet

public Boolean isBookmarklet()
Get whether or not this post was from the bookmarklet

Returns:
boolean

getFormat

public String getFormat()
Get the format for this post

Returns:
the format

getState

public String getState()
Get the current state for this post

Returns:
the state

getPostUrl

public String getPostUrl()
Get the post URL for this post

Returns:
the URL

getTags

public List<String> getTags()
Get a list of the tags for this post

Returns:
the tags

getDateGMT

public String getDateGMT()
Get date of this post as String

Returns:
date GMT string

getTimestamp

public Long getTimestamp()
Get the timestamp of this post

Returns:
timestamp since epoch

getType

public String getType()
Get the type of this post

Returns:
type as String

getId

public Long getId()
Get this post's ID

Returns:
the ID

getBlogName

public String getBlogName()
Get the blog name

Returns:
the blog name for the post

getReblogKey

public String getReblogKey()
Get the reblog key

Returns:
the reblog key

getRebloggedFromId

public Long getRebloggedFromId()
Get the ID of the post that this post reblogged

Returns:
the ID

getRebloggedFromName

public String getRebloggedFromName()
Get name of the blog that this post reblogged

Returns:
the blog name for the post that this post reblogged

delete

public void delete()
Delete this post


reblog

public Post reblog(String blogName,
                   Map<String,?> options)
Reblog this post

Parameters:
blogName - the blog name to reblog onto
options - options to reblog with (or null)
Returns:
reblogged post

reblog

public Post reblog(String blogName)

like

public void like()
Like this post


unlike

public void unlike()
Unlike this post


setBlogName

public void setBlogName(String blogName)
Set the blog name for this post

Parameters:
blogName - the blog name to set

setId

public void setId(long id)
Set the id for this post

Parameters:
id - The id of the post

setFormat

public void setFormat(String format)
Set the format

Parameters:
format - the format

setSlug

public void setSlug(String slug)
Set the slug


setDate

public void setDate(String dateString)
Set the data as a string

Parameters:
dateString - the date to set

setDate

public void setDate(Date date)
Set the date as a date

Parameters:
date - the date to set

setState

public void setState(String state)
Set the state for this post

Parameters:
state - the state

setTags

public void setTags(List<String> tags)
Set the tags for this post


addTag

public void addTag(String tag)
Add a tag


removeTag

public void removeTag(String tag)
Remove a tag


save

public void save()
          throws IOException
Save this post

Throws:
IOException

detail

protected Map<String,Object> detail()
Detail for this post

Returns:
the detail

toString

public String toString()
Post toString

Overrides:
toString in class Object
Returns:
a nice representation of this post


Copyright © 2013. All Rights Reserved.