twitter4j
Class User

java.lang.Object
  extended by twitter4j.TwitterResponse
      extended by twitter4j.User
All Implemented Interfaces:
java.io.Serializable

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.util.Date createdAt
           
private  java.lang.String description
           
private  int favouritesCount
           
private  int followersCount
           
private  boolean following
           
private  int friendsCount
           
private  boolean geoEnabled
           
private  int id
           
private  boolean isProtected
           
private  java.lang.String location
           
private  java.lang.String name
           
private  boolean notificationEnabled
           
(package private) static java.lang.String[] POSSIBLE_ROOT_NAMES
           
private  java.lang.String profileBackgroundColor
           
private  java.lang.String profileBackgroundImageUrl
           
private  java.lang.String profileBackgroundTile
           
private  java.lang.String profileImageUrl
           
private  java.lang.String profileLinkColor
           
private  java.lang.String profileSidebarBorderColor
           
private  java.lang.String profileSidebarFillColor
           
private  java.lang.String profileTextColor
           
private  java.lang.String screenName
           
private static long serialVersionUID
           
private  java.util.Date statusCreatedAt
           
private  int statusesCount
           
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  java.lang.String timeZone
           
private  Twitter twitter
           
private  java.lang.String url
           
private  int utcOffset
           
private  boolean verified
           
 
Constructor Summary
User(twitter4j.org.json.JSONObject json)
           
User(twitter4j.http.Response res, org.w3c.dom.Element elem, Twitter twitter)
           
User(twitter4j.http.Response res, Twitter twitter)
           
 
Method Summary
static java.util.List<User> constructUsers(twitter4j.http.Response res, Twitter twitter)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Date getCreatedAt()
           
 java.lang.String getDescription()
          Returns the description of the user
 int getFavouritesCount()
           
 int getFollowersCount()
          Returns the number of followers
 int getFriendsCount()
           
 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.lang.String getProfileBackgroundColor()
           
 java.lang.String getProfileBackgroundImageUrl()
           
 java.lang.String getProfileBackgroundTile()
           
 java.net.URL getProfileImageURL()
          Returns the profile image url of the user
 java.lang.String getProfileLinkColor()
           
 java.lang.String getProfileSidebarBorderColor()
           
 java.lang.String getProfileSidebarFillColor()
           
 java.lang.String getProfileTextColor()
           
 java.lang.String getScreenName()
          Returns the screen name of the user
 java.util.Date getStatusCreatedAt()
           
 int getStatusesCount()
           
 long getStatusId()
           
 java.lang.String getStatusInReplyToScreenName()
           
 long getStatusInReplyToStatusId()
           
 int getStatusInReplyToUserId()
           
 java.lang.String getStatusSource()
           
 java.lang.String getStatusText()
           
 java.lang.String getTimeZone()
           
 java.net.URL getURL()
          Returns the url of the user
 int getUtcOffset()
           
 int hashCode()
           
private  void init(org.w3c.dom.Element elem, Twitter twitter)
           
private  void init(twitter4j.org.json.JSONObject json)
           
 boolean isFollowing()
          Deprecated. Deprecation of following and notification elements
 boolean isGeoEnabled()
           
 boolean isNotificationEnabled()
          Deprecated. Deprecation of following and notification elements
 boolean isNotifications()
          Deprecated. use isNotificationsEnabled() instead
 boolean isProtected()
          Test if the user status is protected
 boolean isStatusFavorited()
           
 boolean isStatusTruncated()
           
 boolean isVerified()
           
 DirectMessage sendDirectMessage(java.lang.String text)
           
 java.lang.String toString()
           
 
Methods inherited from class twitter4j.TwitterResponse
ensureRootNodeNameIs, ensureRootNodeNameIs, ensureRootNodeNameIs, getBoolean, getChildBoolean, getChildDate, getChildDate, getChildInt, getChildLong, getChildText, getInt, getLong, 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

profileBackgroundColor

private java.lang.String profileBackgroundColor

profileTextColor

private java.lang.String profileTextColor

profileLinkColor

private java.lang.String profileLinkColor

profileSidebarFillColor

private java.lang.String profileSidebarFillColor

profileSidebarBorderColor

private java.lang.String profileSidebarBorderColor

friendsCount

private int friendsCount

createdAt

private java.util.Date createdAt

favouritesCount

private int favouritesCount

utcOffset

private int utcOffset

timeZone

private java.lang.String timeZone

profileBackgroundImageUrl

private java.lang.String profileBackgroundImageUrl

profileBackgroundTile

private java.lang.String profileBackgroundTile

following

private boolean following

notificationEnabled

private boolean notificationEnabled

statusesCount

private int statusesCount

geoEnabled

private boolean geoEnabled

verified

private boolean verified

serialVersionUID

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

User

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

User

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

User

User(twitter4j.org.json.JSONObject json)
throws TwitterException
Throws:
TwitterException
Method Detail

init

private void init(twitter4j.org.json.JSONObject json)
           throws TwitterException
Throws:
TwitterException

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(twitter4j.http.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

getProfileBackgroundColor

public java.lang.String getProfileBackgroundColor()

getProfileTextColor

public java.lang.String getProfileTextColor()

getProfileLinkColor

public java.lang.String getProfileLinkColor()

getProfileSidebarFillColor

public java.lang.String getProfileSidebarFillColor()

getProfileSidebarBorderColor

public java.lang.String getProfileSidebarBorderColor()

getFriendsCount

public int getFriendsCount()

getCreatedAt

public java.util.Date getCreatedAt()

getFavouritesCount

public int getFavouritesCount()

getUtcOffset

public int getUtcOffset()

getTimeZone

public java.lang.String getTimeZone()

getProfileBackgroundImageUrl

public java.lang.String getProfileBackgroundImageUrl()

getProfileBackgroundTile

public java.lang.String getProfileBackgroundTile()

isFollowing

public boolean isFollowing()
Deprecated. Deprecation of following and notification elements


isNotifications

public boolean isNotifications()
Deprecated. use isNotificationsEnabled() instead


isNotificationEnabled

public boolean isNotificationEnabled()
Deprecated. Deprecation of following and notification elements

Since:
Twitter4J 2.0.1

getStatusesCount

public int getStatusesCount()

isGeoEnabled

public boolean isGeoEnabled()
Returns:
the user is enabling geo location
Since:
Twitter4J 2.0.10

isVerified

public boolean isVerified()
Returns:
returns true if the user is a verified celebrity
Since:
Twitter4J 2.0.10

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