winterwell.jtwitter
Class Twitter.Message

java.lang.Object
  extended by winterwell.jtwitter.Twitter.Message
All Implemented Interfaces:
java.io.Serializable, Twitter.ITweet
Enclosing class:
Twitter

public static final class Twitter.Message
extends java.lang.Object
implements Twitter.ITweet

A Twitter direct message. Fields are null if unset. TODO are there more fields now? check the raw json

See Also:
Serialized Form

Field Summary
 java.lang.Number inReplyToMessageId
          Equivalent to Twitter.Status.inReplyToStatusId *but null by default*.
 java.lang.String text
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests by class=Message and tweet id number
 java.util.Date getCreatedAt()
           
 java.lang.Long getId()
          Twitter IDs are numbers - but they can exceed the range of Java's signed long.
 Twitter.User getRecipient()
           
 Twitter.User getSender()
           
 java.lang.String getText()
          The actual status text.
 Twitter.User getUser()
          This is equivalent to getSender()
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

inReplyToMessageId

public java.lang.Number inReplyToMessageId
Equivalent to Twitter.Status.inReplyToStatusId *but null by default*. If you want to use this, you must set it yourself. The field is just a convenient storage place. Strangely Twitter don't report the previous ID for messages.


text

public final java.lang.String text
Method Detail

equals

public boolean equals(java.lang.Object obj)
Tests by class=Message and tweet id number

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getCreatedAt

public java.util.Date getCreatedAt()
Specified by:
getCreatedAt in interface Twitter.ITweet

getId

public java.lang.Long getId()
Description copied from interface: Twitter.ITweet
Twitter IDs are numbers - but they can exceed the range of Java's signed long.

Specified by:
getId in interface Twitter.ITweet
Returns:
The Twitter id for this post. This is used by some API methods.

Note: this may switch to BigInteger in the future, if Twitter change their id numbering scheme. Use Number (which is a super-class for both Long and BigInteger) if you wish to future-proof your code.


getRecipient

public Twitter.User getRecipient()
Returns:
the recipient (for messages sent by the authenticating user)

getSender

public Twitter.User getSender()

getText

public java.lang.String getText()
Description copied from interface: Twitter.ITweet
The actual status text. This is also returned by Object.toString()

Specified by:
getText in interface Twitter.ITweet

getUser

public Twitter.User getUser()
This is equivalent to getSender()

Specified by:
getUser in interface Twitter.ITweet

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object