twitter4j
Class TweetJSONImpl

java.lang.Object
  extended by twitter4j.TweetJSONImpl
All Implemented Interfaces:
java.io.Serializable, Tweet

final class TweetJSONImpl
extends java.lang.Object
implements Tweet, java.io.Serializable

A data class representing a Tweet in the search response

Author:
Yusuke Yamamoto - yusuke at mac.com

Field Summary
private  java.util.Date createdAt
           
private  java.lang.String fromUser
           
private  int fromUserId
           
private  GeoLocation geoLocation
           
private  long id
           
private  java.lang.String isoLanguageCode
           
private  java.lang.String profileImageUrl
           
private static long serialVersionUID
           
private  java.lang.String source
           
private  java.lang.String text
           
private  java.lang.String toUser
           
private  int toUserId
           
 
Constructor Summary
TweetJSONImpl(twitter4j.org.json.JSONObject tweet)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getCreatedAt()
          returns the created_at
 java.lang.String getFromUser()
          returns the from_user
 int getFromUserId()
          returns the user id of the tweet's owner.
Warning: The user ids in the Search API are different from those in the REST API (about the two APIs).
 GeoLocation getGeoLocation()
          Returns The location that this tweet refers to if available.
 long getId()
          returns the status id of the tweet
 java.lang.String getIsoLanguageCode()
          returns the iso language code of the tweet
 java.lang.String getProfileImageUrl()
          returns the profile_image_url
 java.lang.String getSource()
          returns the source of the tweet
 java.lang.String getText()
          returns the text
 java.lang.String getToUser()
          returns the to_user
 int getToUserId()
          returns the to_user_id
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

text

private java.lang.String text

toUserId

private int toUserId

toUser

private java.lang.String toUser

fromUser

private java.lang.String fromUser

id

private long id

fromUserId

private int fromUserId

isoLanguageCode

private java.lang.String isoLanguageCode

source

private java.lang.String source

profileImageUrl

private java.lang.String profileImageUrl

createdAt

private java.util.Date createdAt

geoLocation

private GeoLocation geoLocation

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

TweetJSONImpl

TweetJSONImpl(twitter4j.org.json.JSONObject tweet)
        throws TwitterException
Throws:
TwitterException
Method Detail

getText

public java.lang.String getText()
returns the text

Specified by:
getText in interface Tweet
Returns:
the text

getToUserId

public int getToUserId()
returns the to_user_id

Specified by:
getToUserId in interface Tweet
Returns:
the to_user_id value or -1 if to_user_id is not specified by the tweet

getToUser

public java.lang.String getToUser()
returns the to_user

Specified by:
getToUser in interface Tweet
Returns:
the to_user value or null if to_user is not specified by the tweet

getFromUser

public java.lang.String getFromUser()
returns the from_user

Specified by:
getFromUser in interface Tweet
Returns:
the from_user

getId

public long getId()
returns the status id of the tweet

Specified by:
getId in interface Tweet
Returns:
the status id

getFromUserId

public int getFromUserId()
returns the user id of the tweet's owner.
Warning: The user ids in the Search API are different from those in the REST API (about the two APIs). This defect is being tracked by Issue 214. This means that the to_user_id and from_user_id field vary from the actualy user id on Twitter.com. Applications will have to perform a screen name-based lookup with the users/show method to get the correct user id if necessary.

Specified by:
getFromUserId in interface Tweet
Returns:
the user id of the tweet's owner
See Also:
Issue 214: Search API "from_user_id" doesn't match up with the proper Twitter "user_id"

getIsoLanguageCode

public java.lang.String getIsoLanguageCode()
returns the iso language code of the tweet

Specified by:
getIsoLanguageCode in interface Tweet
Returns:
the iso language code of the tweet or null if iso_language_code is not specified by the tweet

getSource

public java.lang.String getSource()
returns the source of the tweet

Specified by:
getSource in interface Tweet
Returns:
the source of the tweet

getProfileImageUrl

public java.lang.String getProfileImageUrl()
returns the profile_image_url

Specified by:
getProfileImageUrl in interface Tweet
Returns:
the profile_image_url

getCreatedAt

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

Specified by:
getCreatedAt in interface Tweet
Returns:
the created_at

getGeoLocation

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

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

equals

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

hashCode

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

toString

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