org.springframework.social.twitter.api
Class Tweet
java.lang.Object
org.springframework.social.twitter.api.TwitterObject
org.springframework.social.twitter.api.Tweet
- All Implemented Interfaces:
- Serializable
public class Tweet
- extends TwitterObject
- implements Serializable
Represents a Twitter status update (e.g., a "tweet").
- See Also:
- Serialized Form
Tweet
public Tweet(long id,
String text,
Date createdAt,
String fromUser,
String profileImageUrl,
Long toUserId,
long fromUserId,
String languageCode,
String source)
getText
public String getText()
- The text of the tweet. If this tweet is a retweet of another tweet, the text may be preceeded with "RT \@someuser" and may be truncated at the end.
To get the raw, unmodified text of the original tweet, use
getUnmodifiedText()
.
- Returns:
- The text of the tweet.
getUnmodifiedText
public String getUnmodifiedText()
- Returns the unmodified text of the tweet.
If this tweet is a retweet, it returns the text of the original tweet.
If it is not a retweet, then this method will return the same value as
getText()
.
- Returns:
- The unmodified text of the tweet.
getCreatedAt
public Date getCreatedAt()
getFromUser
public String getFromUser()
setFromUser
public void setFromUser(String fromUser)
getId
public long getId()
getProfileImageUrl
public String getProfileImageUrl()
setProfileImageUrl
public void setProfileImageUrl(String profileImageUrl)
getToUserId
public Long getToUserId()
setToUserId
public void setToUserId(Long toUserId)
getFromUserId
public long getFromUserId()
setInReplyToStatusId
public void setInReplyToStatusId(Long inReplyToStatusId)
getInReplyToStatusId
public Long getInReplyToStatusId()
setFromUserId
public void setFromUserId(long fromUserId)
getLanguageCode
public String getLanguageCode()
setLanguageCode
public void setLanguageCode(String languageCode)
getSource
public String getSource()
setSource
public void setSource(String source)
setRetweetCount
public void setRetweetCount(Integer retweetCount)
getRetweetCount
public Integer getRetweetCount()
- The number of times this tweet has been retweeted.
Only available in timeline results.
getRetweetCount() will return null for Tweet objects returned in search results.
setRetweeted
public void setRetweeted(boolean retweeted)
isRetweeted
public boolean isRetweeted()
getRetweetedStatus
public Tweet getRetweetedStatus()
setRetweetedStatus
public void setRetweetedStatus(Tweet tweet)
isRetweet
public boolean isRetweet()
setFavorited
public void setFavorited(boolean favorited)
isFavorited
public boolean isFavorited()
setFavoriteCount
public void setFavoriteCount(Integer favoriteCount)
getFavoriteCount
public Integer getFavoriteCount()
getEntities
public Entities getEntities()
setEntities
public void setEntities(Entities ent)
hasMentions
public boolean hasMentions()
hasMedia
public boolean hasMedia()
hasUrls
public boolean hasUrls()
hasTags
public boolean hasTags()
getUser
public TwitterProfile getUser()
setUser
public void setUser(TwitterProfile prof)
getInReplyToUserId
public Long getInReplyToUserId()
setInReplyToUserId
public void setInReplyToUserId(Long inReplyToUserId)
getInReplyToScreenName
public String getInReplyToScreenName()
setInReplyToScreenName
public void setInReplyToScreenName(String inReplyToScreenName)
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object