winterwell.jtwitter
Interface Twitter.ITweet

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
Message, Status
Enclosing class:
Twitter

public static interface Twitter.ITweet
extends java.io.Serializable

This gives common access to features that are common to both Messages and Statuses.


Method Summary
 java.util.Date getCreatedAt()
           
 java.lang.String getDisplayText()
           
 java.lang.Number getId()
          Twitter IDs are numbers - but they can exceed the range of Java's signed long.
 java.lang.String getLocation()
           
 java.util.List<java.lang.String> getMentions()
           
 Place getPlace()
           
 java.lang.String getText()
          The actual status text.
 java.util.List<Twitter.TweetEntity> getTweetEntities(Twitter.KEntityType type)
          Twitter wrap urls with their own url-shortener (as a defence against malicious tweets).
 User getUser()
          The User who made the tweet
 

Method Detail

getCreatedAt

java.util.Date getCreatedAt()

getId

java.lang.Number getId()
Twitter IDs are numbers - but they can exceed the range of Java's signed long.

Returns:
The Twitter id for this post. This is used by some API methods. This may be a Long or a BigInteger.

getLocation

java.lang.String getLocation()
Returns:
the location of this tweet. Can be null, never blank. This can come from geo-tagging or the user's location. This may be a place name, or in the form "latitude,longitude" if it came from a geo-tagged source.

Note: This will be set if Twitter supply any geo-information. We extract a location from geo and place objects.


getMentions

java.util.List<java.lang.String> getMentions()
Returns:
list of screen-names this message is to. May be empty, never null. For Statuses, this is anyone mentioned in the message. For DMs, this is a wrapper round Message.getRecipient().

Notes: This method is in ITweet as a convenience to allow the same code to process both Statuses and Messages where possible. It would be better named "getRecipients()", but for historical reasons it isn't.


getPlace

Place getPlace()
Returns:
more information on the location of this tweet. This is usually null!

getText

java.lang.String getText()
The actual status text. This is also returned by Twitter.toString()


getTweetEntities

java.util.List<Twitter.TweetEntity> getTweetEntities(Twitter.KEntityType type)
Twitter wrap urls with their own url-shortener (as a defence against malicious tweets). You are recommended to direct people to the Twitter-url, but use the original url for display.

Entity support is off by default. Request entity support by setting Twitter.setIncludeTweetEntities(boolean). Twitter do NOT support entities for search :(

Parameters:
type - urls, user_mentions, or hashtags
Returns:
the text entities in this tweet, or null if the info was not supplied.

getUser

User getUser()
The User who made the tweet


getDisplayText

java.lang.String getDisplayText()
Returns:
text, with the t.co urls replaced. Use-case: for filtering based on text contents, when we want to match against the full url. Note: this does NOT resolve short urls from bit.ly etc.