twitter4j
Class User

java.lang.Object
  extended by twitter4j.TwitterResponse
      extended by twitter4j.User
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UserWithStatus

public class User
extends TwitterResponse
implements java.io.Serializable

A data class representing Basic user information element

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
REST API Documentation - Basic user information element, Serialized Form

Field Summary
private  java.lang.String description
           
private  int followersCount
           
private  int id
           
private  boolean isProtected
           
private  java.lang.String location
           
private  java.lang.String name
           
(package private) static java.lang.String[] POSSIBLE_ROOT_NAMES
           
private  java.lang.String profileImageUrl
           
private  java.lang.String screenName
           
private static long serialVersionUID
           
private  java.util.Date statusCreatedAt
           
private  boolean statusFavorited
           
private  long statusId
           
private  java.lang.String statusInReplyToScreenName
           
private  long statusInReplyToStatusId
           
private  int statusInReplyToUserId
           
private  java.lang.String statusSource
           
private  java.lang.String statusText
           
private  boolean statusTruncated
           
private  Twitter twitter
           
private  java.lang.String url
           
 
Constructor Summary
User(Response res, org.w3c.dom.Element elem, Twitter twitter)
           
User(Response res, Twitter twitter)
           
 
Method Summary
static java.util.List<User> constructUsers(Response res, Twitter twitter)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDescription()
          Returns the description of the user
 int getFollowersCount()
          Returns the number of followers
 int getId()
          Returns the id of the user
 java.lang.String getLocation()
          Returns the location of the user
 java.lang.String getName()
          Returns the name of the user
 java.net.URL getProfileImageURL()
          Returns the profile image url of the user
 java.lang.String getScreenName()
          Returns the screen name of the user
 java.util.Date getStatusCreatedAt()
           
 long getStatusId()
           
 java.lang.String getStatusInReplyToScreenName()
           
 long getStatusInReplyToStatusId()
           
 int getStatusInReplyToUserId()
           
 java.lang.String getStatusSource()
           
 java.lang.String getStatusText()
           
 java.net.URL getURL()
          Returns the url of the user
 int hashCode()
           
private  void init(org.w3c.dom.Element elem, Twitter twitter)
           
 boolean isProtected()
          Test if the user status is protected
 boolean isStatusFavorited()
           
 boolean isStatusTruncated()
           
 DirectMessage sendDirectMessage(java.lang.String text)
           
 java.lang.String toString()
           
 
Methods inherited from class twitter4j.TwitterResponse
ensureRootNodeNameIs, ensureRootNodeNameIs, ensureRootNodeNameIs, getChildBoolean, getChildDate, getChildDate, getChildInt, getChildLong, getChildText, getRateLimitLimit, getRateLimitRemaining, getRateLimitReset, getString, getTextContent, isRootNodeNilClasses, parseDate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

POSSIBLE_ROOT_NAMES

static final java.lang.String[] POSSIBLE_ROOT_NAMES

twitter

private Twitter twitter

id

private int id

name

private java.lang.String name

screenName

private java.lang.String screenName

location

private java.lang.String location

description

private java.lang.String description

profileImageUrl

private java.lang.String profileImageUrl

url

private java.lang.String url

isProtected

private boolean isProtected

followersCount

private int followersCount

statusCreatedAt

private java.util.Date statusCreatedAt

statusId

private long statusId

statusText

private java.lang.String statusText

statusSource

private java.lang.String statusSource

statusTruncated

private boolean statusTruncated

statusInReplyToStatusId

private long statusInReplyToStatusId

statusInReplyToUserId

private int statusInReplyToUserId

statusFavorited

private boolean statusFavorited

statusInReplyToScreenName

private java.lang.String statusInReplyToScreenName

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

User

User(Response res,
     Twitter twitter)
throws TwitterException
Throws:
TwitterException

User

User(Response res,
     org.w3c.dom.Element elem,
     Twitter twitter)
throws TwitterException
Throws:
TwitterException
Method Detail

init

private void init(org.w3c.dom.Element elem,
                  Twitter twitter)
           throws TwitterException
Throws:
TwitterException

getId

public int getId()
Returns the id of the user

Returns:
the id of the user

getName

public java.lang.String getName()
Returns the name of the user

Returns:
the name of the user

getScreenName

public java.lang.String getScreenName()
Returns the screen name of the user

Returns:
the screen name of the user

getLocation

public java.lang.String getLocation()
Returns the location of the user

Returns:
the location of the user

getDescription

public java.lang.String getDescription()
Returns the description of the user

Returns:
the description of the user

getProfileImageURL

public java.net.URL getProfileImageURL()
Returns the profile image url of the user

Returns:
the profile image url of the user

getURL

public java.net.URL getURL()
Returns the url of the user

Returns:
the url of the user

isProtected

public boolean isProtected()
Test if the user status is protected

Returns:
true if the user status is protected

getFollowersCount

public int getFollowersCount()
Returns the number of followers

Returns:
the number of followers
Since:
Twitter4J 1.0.4

sendDirectMessage

public DirectMessage sendDirectMessage(java.lang.String text)
                                throws TwitterException
Throws:
TwitterException

constructUsers

public static java.util.List<User> constructUsers(Response res,
                                                  Twitter twitter)
                                           throws TwitterException
Throws:
TwitterException

getStatusCreatedAt

public java.util.Date getStatusCreatedAt()
Returns:
created_at or null if the user is protected
Since:
Twitter4J 1.1.0

getStatusId

public long getStatusId()
Returns:
status id or -1 if the user is protected

getStatusText

public java.lang.String getStatusText()
Returns:
status text or null if the user is protected

getStatusSource

public java.lang.String getStatusSource()
Returns:
source or null if the user is protected
Since:
1.1.4

isStatusTruncated

public boolean isStatusTruncated()
Returns:
truncated or false if the user is protected
Since:
1.1.4

getStatusInReplyToStatusId

public long getStatusInReplyToStatusId()
Returns:
in_reply_to_status_id or -1 if the user is protected
Since:
1.1.4

getStatusInReplyToUserId

public int getStatusInReplyToUserId()
Returns:
in_reply_to_user_id or -1 if the user is protected
Since:
1.1.4

isStatusFavorited

public boolean isStatusFavorited()
Returns:
favorited or false if the user is protected
Since:
1.1.4

getStatusInReplyToScreenName

public java.lang.String getStatusInReplyToScreenName()
Returns:
in_reply_to_screen_name or null if the user is protected
Since:
1.1.4

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

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