|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.twitterapime.model.DefaultEntity
com.twitterapime.search.Tweet
public final class Tweet
This class defines an entity that represents a Tweet. A tweet is a message posted by an user to Twitter.
SearchDevice
,
TweetER
Field Summary | |
---|---|
static int |
MAX_CHARACTERS
Content max number of characters. |
Fields inherited from class com.twitterapime.model.DefaultEntity |
---|
data |
Constructor Summary | |
---|---|
Tweet()
Create an instance of Tweet class. |
|
Tweet(java.util.Hashtable data)
Create an instance of Tweet class. |
|
Tweet(java.lang.String content)
Create an instance of Tweet class. |
|
Tweet(java.lang.String content,
GeoLocation location)
Create an instance of Tweet class. |
|
Tweet(java.lang.String toUserNameOrID,
java.lang.String content)
Create an instance of Tweet class. This constructor is used when the Tweet object is going to be sent as a Direct Message. |
Method Summary | |
---|---|
GeoLocation |
getLocation()
Get the tweet's location object. |
UserAccount |
getRecipientAccount()
Get the recipient account. Call this method to retrieve info about the recipient user by sending a Direct Message. |
Tweet |
getRepostedTweet()
Get the reposted tweet object. |
UserAccount |
getUserAccount()
Get the user account. |
void |
validateContent()
Validate tweet's content. |
void |
validateRecipient()
Validate Direct Messsage's recipient info. |
Methods inherited from class com.twitterapime.model.DefaultEntity |
---|
equals, getArray, getDate, getInt, getLong, getObject, getString, hashCode, setData, setData, size, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_CHARACTERS
Content max number of characters.
Constructor Detail |
---|
public Tweet()
Create an instance of Tweet class.
public Tweet(java.util.Hashtable data)
Create an instance of Tweet class.
data
- The initial attributes/values.public Tweet(java.lang.String content)
Create an instance of Tweet class.
content
- Content (status).
java.lang.IllegalArgumentException
- If content is invalid.public Tweet(java.lang.String content, GeoLocation location)
Create an instance of Tweet class.
To set this tweet's location, enable Tweet Location settings of current authenticated user account on Twitter website.
content
- Content (status).location
- Tweet's location.
java.lang.IllegalArgumentException
- If content is invalid.public Tweet(java.lang.String toUserNameOrID, java.lang.String content)
Create an instance of Tweet class.
This constructor is used when the Tweet object is going to be sent as a
Direct Message.
toUserNameOrID
- Username or ID from recipient user.content
- Content (message).
java.lang.IllegalArgumentException
- If toUserNameOrID and/or content are
invalid.Method Detail |
---|
public void validateContent()
Validate tweet's content.
java.lang.IllegalArgumentException
- If the content is null/empty or exceeds
140 characters.public void validateRecipient()
Validate Direct Messsage's recipient info.
java.lang.IllegalArgumentException
- If the recipient info is null/empty.public UserAccount getUserAccount()
Get the user account.
public UserAccount getRecipientAccount()
Get the recipient account.
Call this method to retrieve info about
the recipient user by sending a Direct Message.
public Tweet getRepostedTweet()
Get the reposted tweet object.
public GeoLocation getLocation()
Get the tweet's location object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |