twitter4j
Class UserJSONImpl

java.lang.Object
  extended by twitter4j.TwitterResponseImpl
      extended by twitter4j.UserJSONImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<User>, TwitterResponse, User

final class UserJSONImpl
extends TwitterResponseImpl
implements User, 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

Field Summary
private  java.util.Date createdAt
           
private  java.lang.String description
           
private  int favouritesCount
           
private  int followersCount
           
private  int friendsCount
           
private  long id
           
private  boolean isContributorsEnabled
           
private  boolean isFollowRequestSent
           
private  boolean isGeoEnabled
           
private  boolean isProtected
           
private  boolean isVerified
           
private  java.lang.String lang
           
private  int listedCount
           
private  java.lang.String location
           
private  java.lang.String name
           
private  java.lang.String profileBackgroundColor
           
private  java.lang.String profileBackgroundImageUrl
           
private  boolean profileBackgroundTiled
           
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  boolean profileUseBackgroundImage
           
private  java.lang.String screenName
           
private static long serialVersionUID
           
private  boolean showAllInlineMedia
           
private  Status status
           
private  int statusesCount
           
private  java.lang.String timeZone
           
private  boolean translator
           
private  java.lang.String url
           
private  int utcOffset
           
 
Constructor Summary
UserJSONImpl(twitter4j.internal.http.HttpResponse res)
           
UserJSONImpl(twitter4j.internal.org.json.JSONObject json)
           
 
Method Summary
 int compareTo(User that)
           
(package private) static PagableResponseList<User> createPagableUserList(twitter4j.internal.http.HttpResponse res)
           
(package private) static ResponseList<User> createUserList(twitter4j.internal.http.HttpResponse res)
           
(package private) static ResponseList<User> createUserList(twitter4j.internal.org.json.JSONArray list, twitter4j.internal.http.HttpResponse res)
           
 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()
          
 long getId()
          Returns the id of the user
 java.lang.String getLang()
          Returns the preferred language of the user
 int getListedCount()
          Returns the number of public lists the user is listed on, or -1 if the count is unavailable.
 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.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
 Status getStatus()
          Returns the current status of the user
This can be null if the instance if from Status.getUser().
 int getStatusesCount()
          
 java.lang.String getTimeZone()
          
 java.net.URL getURL()
          Returns the url of the user
 int getUtcOffset()
          
 int hashCode()
           
private  void init(twitter4j.internal.org.json.JSONObject json)
           
 boolean isContributorsEnabled()
          Tests if the user is enabling contributors
 boolean isFollowRequestSent()
          Returns true if the authenticating user has requested to follow this user, otherwise false.
 boolean isGeoEnabled()
          
 boolean isProfileBackgroundTiled()
          
 boolean isProfileUseBackgroundImage()
          
 boolean isProtected()
          Test if the user status is protected
 boolean isShowAllInlineMedia()
          
 boolean isTranslator()
          
 boolean isVerified()
          
 java.lang.String toString()
           
 
Methods inherited from class twitter4j.TwitterResponseImpl
getRateLimitStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface twitter4j.TwitterResponse
getRateLimitStatus
 

Field Detail

id

private long 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

isContributorsEnabled

private boolean isContributorsEnabled

profileImageUrl

private java.lang.String profileImageUrl

url

private java.lang.String url

isProtected

private boolean isProtected

followersCount

private int followersCount

status

private Status status

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

profileUseBackgroundImage

private boolean profileUseBackgroundImage

showAllInlineMedia

private boolean showAllInlineMedia

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

profileBackgroundTiled

private boolean profileBackgroundTiled

lang

private java.lang.String lang

statusesCount

private int statusesCount

isGeoEnabled

private boolean isGeoEnabled

isVerified

private boolean isVerified

translator

private boolean translator

listedCount

private int listedCount

isFollowRequestSent

private boolean isFollowRequestSent

serialVersionUID

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

UserJSONImpl

UserJSONImpl(twitter4j.internal.http.HttpResponse res)
       throws TwitterException
Throws:
TwitterException

UserJSONImpl

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

init

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

compareTo

public int compareTo(User that)
Specified by:
compareTo in interface java.lang.Comparable<User>

getId

public long getId()
Returns the id of the user

Specified by:
getId in interface User
Returns:
the id of the user

getName

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

Specified by:
getName in interface User
Returns:
the name of the user

getScreenName

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

Specified by:
getScreenName in interface User
Returns:
the screen name of the user

getLocation

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

Specified by:
getLocation in interface User
Returns:
the location of the user

getDescription

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

Specified by:
getDescription in interface User
Returns:
the description of the user

isContributorsEnabled

public boolean isContributorsEnabled()
Tests if the user is enabling contributors

Specified by:
isContributorsEnabled in interface User
Returns:
if the user is enabling contributors

getProfileImageURL

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

Specified by:
getProfileImageURL in interface User
Returns:
the profile image url of the user

getURL

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

Specified by:
getURL in interface User
Returns:
the url of the user

isProtected

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

Specified by:
isProtected in interface User
Returns:
true if the user status is protected

getFollowersCount

public int getFollowersCount()
Returns the number of followers

Specified by:
getFollowersCount in interface User
Returns:
the number of followers

getProfileBackgroundColor

public java.lang.String getProfileBackgroundColor()

Specified by:
getProfileBackgroundColor in interface User

getProfileTextColor

public java.lang.String getProfileTextColor()
Specified by:
getProfileTextColor in interface User

getProfileLinkColor

public java.lang.String getProfileLinkColor()

Specified by:
getProfileLinkColor in interface User

getProfileSidebarFillColor

public java.lang.String getProfileSidebarFillColor()

Specified by:
getProfileSidebarFillColor in interface User

getProfileSidebarBorderColor

public java.lang.String getProfileSidebarBorderColor()

Specified by:
getProfileSidebarBorderColor in interface User

isProfileUseBackgroundImage

public boolean isProfileUseBackgroundImage()

Specified by:
isProfileUseBackgroundImage in interface User

isShowAllInlineMedia

public boolean isShowAllInlineMedia()

Specified by:
isShowAllInlineMedia in interface User

getFriendsCount

public int getFriendsCount()

Specified by:
getFriendsCount in interface User

getStatus

public Status getStatus()
Returns the current status of the user
This can be null if the instance if from Status.getUser().

Specified by:
getStatus in interface User
Returns:
current status of the user

getCreatedAt

public java.util.Date getCreatedAt()

Specified by:
getCreatedAt in interface User

getFavouritesCount

public int getFavouritesCount()

Specified by:
getFavouritesCount in interface User

getUtcOffset

public int getUtcOffset()

Specified by:
getUtcOffset in interface User

getTimeZone

public java.lang.String getTimeZone()

Specified by:
getTimeZone in interface User

getProfileBackgroundImageUrl

public java.lang.String getProfileBackgroundImageUrl()

Specified by:
getProfileBackgroundImageUrl in interface User

isProfileBackgroundTiled

public boolean isProfileBackgroundTiled()

Specified by:
isProfileBackgroundTiled in interface User

getLang

public java.lang.String getLang()
Returns the preferred language of the user

Specified by:
getLang in interface User
Returns:
the preferred language of the user

getStatusesCount

public int getStatusesCount()

Specified by:
getStatusesCount in interface User

isGeoEnabled

public boolean isGeoEnabled()

Specified by:
isGeoEnabled in interface User
Returns:
the user is enabling geo location

isVerified

public boolean isVerified()

Specified by:
isVerified in interface User
Returns:
returns true if the user is a verified celebrity

isTranslator

public boolean isTranslator()

Specified by:
isTranslator in interface User
Returns:
returns true if the user is a translator

getListedCount

public int getListedCount()
Returns the number of public lists the user is listed on, or -1 if the count is unavailable.

Specified by:
getListedCount in interface User
Returns:
the number of public lists the user is listed on.

isFollowRequestSent

public boolean isFollowRequestSent()
Returns true if the authenticating user has requested to follow this user, otherwise false.

Specified by:
isFollowRequestSent in interface User
Returns:
true if the authenticating user has requested to follow this user.

createPagableUserList

static PagableResponseList<User> createPagableUserList(twitter4j.internal.http.HttpResponse res)
                                                throws TwitterException
Throws:
TwitterException

createUserList

static ResponseList<User> createUserList(twitter4j.internal.http.HttpResponse res)
                                  throws TwitterException
Throws:
TwitterException

createUserList

static ResponseList<User> createUserList(twitter4j.internal.org.json.JSONArray list,
                                         twitter4j.internal.http.HttpResponse res)
                                  throws TwitterException
Throws:
TwitterException

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