twitter4j
Class StatusJSONImpl

java.lang.Object
  extended by twitter4j.TwitterResponseImpl
      extended by twitter4j.StatusJSONImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Status>, Status, TwitterResponse

final class StatusJSONImpl
extends TwitterResponseImpl
implements Status, java.io.Serializable

A data class representing one single status of a user.

Author:
Yusuke Yamamoto - yusuke at mac.com

Field Summary
private  Annotations annotations
           
private  java.lang.String[] contributors
           
private  java.util.Date createdAt
           
private  GeoLocation geoLocation
           
private  HashtagEntity[] hashtagEntities
           
private  long id
           
private  java.lang.String inReplyToScreenName
           
private  long inReplyToStatusId
           
private  long inReplyToUserId
           
private  boolean isFavorited
           
private  boolean isTruncated
           
private static twitter4j.internal.logging.Logger logger
           
private  Place place
           
private  long retweetCount
           
private  Status retweetedStatus
           
private static long serialVersionUID
           
private  java.lang.String source
           
private  java.lang.String text
           
private  URLEntity[] urlEntities
           
private  User user
           
private  UserMentionEntity[] userMentionEntities
           
private  boolean wasRetweetedByMe
           
 
Constructor Summary
StatusJSONImpl(twitter4j.internal.http.HttpResponse res, Configuration conf)
           
StatusJSONImpl(twitter4j.internal.org.json.JSONObject json)
           
 
Method Summary
 int compareTo(Status that)
           
(package private) static ResponseList<Status> createStatusList(twitter4j.internal.http.HttpResponse res, Configuration conf)
           
 boolean equals(java.lang.Object obj)
           
 Annotations getAnnotations()
          Returns the annotations, or null if no annotations are associated with this status.
 java.lang.String[] getContributors()
          Returns an array of contributors, or null if no contributor is associated with this status.
 java.util.Date getCreatedAt()
          Return the created_at
 GeoLocation getGeoLocation()
          Returns The location that this tweet refers to if available.
 HashtagEntity[] getHashtagEntities()
          Returns an array if hashtag mentioned in the tweet, or null if no hashtag were mentioned.
 long getId()
          Returns the id of the status
 java.lang.String getInReplyToScreenName()
          Returns the in_reply_to_screen_name
 long getInReplyToStatusId()
          Returns the in_reply_tostatus_id
 long getInReplyToUserId()
          Returns the in_reply_user_id
 Place getPlace()
          Returns the place attached to this status
 long getRetweetCount()
          Returns the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.
 Status getRetweetedStatus()
          
 java.lang.String getSource()
          Returns the source
 java.lang.String getText()
          Returns the text of the status
 URLEntity[] getURLEntities()
          Returns an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.
 User getUser()
          Return the user associated with the status.
This can be null if the instance if from User.getStatus().
 UserMentionEntity[] getUserMentionEntities()
          Returns an array of user mentions in the tweet, or null if no users were mentioned.
 int hashCode()
           
private  void init(twitter4j.internal.org.json.JSONObject json)
           
 boolean isFavorited()
          Test if the status is favorited
 boolean isRetweet()
          
 boolean isRetweetedByMe()
          Returns true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
 boolean isTruncated()
          Test if the status is truncated
 java.lang.String toString()
           
 
Methods inherited from class twitter4j.TwitterResponseImpl
getRateLimitStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface twitter4j.TwitterResponse
getRateLimitStatus
 

Field Detail

logger

private static final twitter4j.internal.logging.Logger logger

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

createdAt

private java.util.Date createdAt

id

private long id

text

private java.lang.String text

source

private java.lang.String source

isTruncated

private boolean isTruncated

inReplyToStatusId

private long inReplyToStatusId

inReplyToUserId

private long inReplyToUserId

isFavorited

private boolean isFavorited

inReplyToScreenName

private java.lang.String inReplyToScreenName

geoLocation

private GeoLocation geoLocation

place

private Place place

retweetCount

private long retweetCount

wasRetweetedByMe

private boolean wasRetweetedByMe

contributors

private java.lang.String[] contributors

annotations

private Annotations annotations

retweetedStatus

private Status retweetedStatus

userMentionEntities

private UserMentionEntity[] userMentionEntities

urlEntities

private URLEntity[] urlEntities

hashtagEntities

private HashtagEntity[] hashtagEntities

user

private User user
Constructor Detail

StatusJSONImpl

StatusJSONImpl(twitter4j.internal.http.HttpResponse res,
               Configuration conf)
         throws TwitterException
Throws:
TwitterException

StatusJSONImpl

StatusJSONImpl(twitter4j.internal.org.json.JSONObject json)
         throws TwitterException
Throws:
TwitterException
Method Detail

init

private void init(twitter4j.internal.org.json.JSONObject json)
           throws TwitterException
Throws:
TwitterException

compareTo

public int compareTo(Status that)
Specified by:
compareTo in interface java.lang.Comparable<Status>

getCreatedAt

public java.util.Date getCreatedAt()
Return the created_at

Specified by:
getCreatedAt in interface Status
Returns:
created_at

getId

public long getId()
Returns the id of the status

Specified by:
getId in interface Status
Returns:
the id

getText

public java.lang.String getText()
Returns the text of the status

Specified by:
getText in interface Status
Returns:
the text

getSource

public java.lang.String getSource()
Returns the source

Specified by:
getSource in interface Status
Returns:
the source

isTruncated

public boolean isTruncated()
Test if the status is truncated

Specified by:
isTruncated in interface Status
Returns:
true if truncated

getInReplyToStatusId

public long getInReplyToStatusId()
Returns the in_reply_tostatus_id

Specified by:
getInReplyToStatusId in interface Status
Returns:
the in_reply_tostatus_id

getInReplyToUserId

public long getInReplyToUserId()
Returns the in_reply_user_id

Specified by:
getInReplyToUserId in interface Status
Returns:
the in_reply_tostatus_id

getInReplyToScreenName

public java.lang.String getInReplyToScreenName()
Returns the in_reply_to_screen_name

Specified by:
getInReplyToScreenName in interface Status
Returns:
the in_in_reply_to_screen_name

getGeoLocation

public GeoLocation getGeoLocation()
Returns The location that this tweet refers to if available.

Specified by:
getGeoLocation in interface Status
Returns:
returns The location that this tweet refers to if available (can be null)

getPlace

public Place getPlace()
Returns the place attached to this status

Specified by:
getPlace in interface Status
Returns:
The place attached to this status

getContributors

public java.lang.String[] getContributors()
Returns an array of contributors, or null if no contributor is associated with this status.

Specified by:
getContributors in interface Status

getAnnotations

public Annotations getAnnotations()
Returns the annotations, or null if no annotations are associated with this status.

Specified by:
getAnnotations in interface Status

isFavorited

public boolean isFavorited()
Test if the status is favorited

Specified by:
isFavorited in interface Status
Returns:
true if favorited

getUser

public User getUser()
Return the user associated with the status.
This can be null if the instance if from User.getStatus().

Specified by:
getUser in interface Status
Returns:
the user

isRetweet

public boolean isRetweet()

Specified by:
isRetweet in interface Status

getRetweetedStatus

public Status getRetweetedStatus()

Specified by:
getRetweetedStatus in interface Status

getRetweetCount

public long getRetweetCount()
Returns the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.

Specified by:
getRetweetCount in interface Status
Returns:
the retweet count.

isRetweetedByMe

public boolean isRetweetedByMe()
Returns true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.

Specified by:
isRetweetedByMe in interface Status
Returns:
whether the authenticating user has retweeted this tweet.

getUserMentionEntities

public UserMentionEntity[] getUserMentionEntities()
Returns an array of user mentions in the tweet, or null if no users were mentioned.

Specified by:
getUserMentionEntities in interface Status
Returns:
An array of user mention entities in the tweet.

getURLEntities

public URLEntity[] getURLEntities()
Returns an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.

Specified by:
getURLEntities in interface Status
Returns:
An array of URLEntity mentioned in the tweet.

getHashtagEntities

public HashtagEntity[] getHashtagEntities()
Returns an array if hashtag mentioned in the tweet, or null if no hashtag were mentioned.

Specified by:
getHashtagEntities in interface Status
Returns:
An array of Hashtag mentioned in the tweet.

createStatusList

static ResponseList<Status> createStatusList(twitter4j.internal.http.HttpResponse res,
                                             Configuration conf)
                                      throws TwitterException
Throws:
TwitterException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object