twitter4j
Interface Tweet

All Superinterfaces:
Comparable<Tweet>, EntitySupport, Serializable, Twt

public interface Tweet
extends Comparable<Tweet>, EntitySupport, Twt, Serializable

A data class representing a Tweet in the search response

Author:
Yusuke Yamamoto - yusuke at mac.com

Method Summary
 Annotations getAnnotations()
          Returns the annotations of the tweet.
 Date getCreatedAt()
          returns the created_at
 String getFromUser()
          returns the from_user
 long 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).
 String getFromUserName()
          returns the from_user_name
 GeoLocation getGeoLocation()
          Returns The location that this tweet refers to if available.
 long getId()
          returns the status id of the tweet
 long getInReplyToStatusId()
          Returns the in_reply_tostatus_id
 String getIsoLanguageCode()
          returns the iso language code of the tweet
 String getLocation()
          Returns the textual location where this tweet was posted.
 Place getPlace()
          Returns the place associated with the post.
 String getProfileImageUrl()
          returns the profile_image_url
 String getSource()
          returns the source of the tweet
 String getText()
          returns the text
 String getToUser()
          returns the to_user
 long getToUserId()
          returns the to_user_id
 String getToUserName()
          returns the to_user_name
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface twitter4j.EntitySupport
getHashtagEntities, getMediaEntities, getURLEntities, getUserMentionEntities
 

Method Detail

getText

String getText()
returns the text

Specified by:
getText in interface Twt
Returns:
the text

getToUserId

long 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

String getToUser()
returns the to_user

Returns:
the to_user value or null if to_user is not specified by the tweet

getToUserName

String getToUserName()
returns the to_user_name

Returns:
the to_user_name value or null if to_user is not specified by the tweet

getFromUser

String getFromUser()
returns the from_user

Returns:
the from_user

getFromUserName

String getFromUserName()
returns the from_user_name

Returns:
the from_user_name
Since:
Twitter4J 2.2.6

getId

long getId()
returns the status id of the tweet

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

getFromUserId

long 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

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

String getSource()
returns the source of the tweet

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

getInReplyToStatusId

long getInReplyToStatusId()
Returns the in_reply_tostatus_id

Specified by:
getInReplyToStatusId in interface Twt
Returns:
the in_reply_tostatus_id
Since:
Twitter4J 2.2.6

getProfileImageUrl

String getProfileImageUrl()
returns the profile_image_url

Returns:
the profile_image_url

getCreatedAt

Date getCreatedAt()
returns the created_at

Specified by:
getCreatedAt in interface Twt
Returns:
the created_at

getGeoLocation

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

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

getLocation

String getLocation()
Returns the textual location where this tweet was posted. This location is useful when no GeoLocation information is available, but must be translated to coordinates via a GeoQuery.

Returns:
The textual location where this tweet was posted

getPlace

Place getPlace()
Returns the place associated with the post.

Specified by:
getPlace in interface Twt
Returns:
The place associated with the post

getAnnotations

Annotations getAnnotations()
Returns the annotations of the tweet. At the moment this code is written (2010-08-18), Twitter Search API does not support annotations yet (so even annotated tweets are returned without the annotations). This method is included here for completeness and for future use.

Returns:
the annotations
Since:
Twitter4J 2.1.4


Copyright © 2012. All Rights Reserved.