twitter4j
Class Tweet

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

public class Tweet
extends TwitterResponse

A data class representing a Tweet in the search response

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Field Summary
private  java.util.Date createdAt
           
private  java.lang.String fromUser
           
private  int fromUserId
           
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
Tweet(twitter4j.org.json.JSONObject tweet, TwitterSupport twitterSupport)
           
 
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).
 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 twitter4j.TwitterResponse
ensureRootNodeNameIs, ensureRootNodeNameIs, ensureRootNodeNameIs, getBoolean, getChildBoolean, getChildDate, getChildDate, getChildInt, getChildLong, getChildText, getInt, getLong, getRateLimitLimit, getRateLimitRemaining, getRateLimitReset, getString, getTextContent, isRootNodeNilClasses, parseDate
 
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

serialVersionUID

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

Tweet

Tweet(twitter4j.org.json.JSONObject tweet,
      TwitterSupport twitterSupport)
throws TwitterException
Throws:
TwitterException
Method Detail

getText

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

Returns:
the text

getToUserId

public int getToUserId()
returns the to_user_id

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

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

Returns:
the from_user

getId

public long getId()
returns the status id of the 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.

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

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

Returns:
the source of the tweet

getProfileImageUrl

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

Returns:
the profile_image_url

getCreatedAt

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

Returns:
the created_at

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