public final class User
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
java.util.Date |
createdAt |
java.lang.String |
description |
int |
favoritesCount |
int |
followersCount
The number of people who follow this user.
|
boolean |
followRequestSent
True if the authenticated user has requested to follow this user.
|
int |
friendsCount
The number of people this user is following.
|
java.lang.Long |
id |
int |
listedCount
The number of public lists a user is listed in.
|
java.lang.String |
location
The location, as reported by the user.
|
java.lang.String |
name
The display name, e.g.
|
boolean |
notifications |
java.lang.String |
profileBackgroundColor |
java.net.URI |
profileBackgroundImageUrl |
boolean |
profileBackgroundTile |
java.net.URI |
profileImageUrl
The url for the user's Twitter profile picture.
|
java.net.URI |
profileImageUrlHttps |
java.lang.String |
profileLinkColor |
java.lang.String |
profileSidebarBorderColor |
java.lang.String |
profileSidebarFillColor |
java.lang.String |
profileTextColor |
boolean |
protectedUser
true if this user keeps their updates private
|
java.lang.String |
screenName
The login name, e.g.
|
Status |
status
The user's current status - *if* returned by Twitter.
|
int |
statusesCount |
java.lang.String |
timezone |
double |
timezoneOffSet
Number of seconds between a user's registered time zone and Greenwich
Mean Time (GMT) - aka Coordinated Universal Time or UTC.
|
boolean |
verified |
java.net.URI |
website |
Constructor and Description |
---|
User(com.winterwell.json.JSONObject obj,
Status status)
Create a User from a json blob
|
User(java.lang.String screenName)
Create a dummy User object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.util.Date |
getCreatedAt() |
java.lang.String |
getDescription() |
int |
getFavoritesCount()
Number of statuses a user has marked as favorite.
Warning: can be zero if Twitter did not supply the info (e.g. |
int |
getFollowersCount() |
int |
getFriendsCount() |
java.lang.Long |
getId() |
java.lang.String |
getLang()
User's language (2 letter code)
|
java.lang.String |
getLocation() |
java.lang.String |
getName()
The display name, e.g.
|
Place |
getPlace() |
java.lang.String |
getProfileBackgroundColor() |
java.net.URI |
getProfileBackgroundImageUrl() |
java.net.URI |
getProfileImageUrl() |
java.lang.String |
getProfileLinkColor() |
java.lang.String |
getProfileSidebarBorderColor() |
java.lang.String |
getProfileSidebarFillColor() |
java.lang.String |
getProfileTextColor() |
boolean |
getProtectedUser() |
java.lang.String |
getScreenName()
The login name, e.g.
|
Status |
getStatus()
The user's current status - *if* returned by Twitter.
|
int |
getStatusesCount() |
java.lang.String |
getTimezone()
String version of the timezone
|
double |
getTimezoneOffSet()
Number of seconds between a user's registered time zone and Greenwich
Mean Time (GMT) - aka Coordinated Universal Time or UTC.
|
java.net.URI |
getWebsite() |
int |
hashCode() |
boolean |
isDummyObject() |
java.lang.Boolean |
isFollowedByYou()
Are you following this person?
|
java.lang.Boolean |
isFollowingYou()
Is this person following you?
|
boolean |
isNotifications() |
boolean |
isProfileBackgroundTile() |
boolean |
isProtectedUser()
true if this user keeps their updates private
|
boolean |
isVerified() |
java.lang.String |
toString()
Returns the User's screenName (i.e.
|
public final java.util.Date createdAt
public final java.lang.String description
public final int favoritesCount
public int followersCount
public final boolean followRequestSent
public final int friendsCount
"following count" would be a better name, but historically Twitter calls this "friends count".
public final java.lang.Long id
public final int listedCount
public final java.lang.String location
InternalUtils.latLongLocn
.public final java.lang.String name
public final boolean notifications
public final java.lang.String profileBackgroundColor
public final java.net.URI profileBackgroundImageUrl
public final boolean profileBackgroundTile
public java.net.URI profileImageUrl
Note: we allow this to be edited as a convenience for the User objects generated by search
public java.net.URI profileImageUrlHttps
public final java.lang.String profileLinkColor
public final java.lang.String profileSidebarBorderColor
public final java.lang.String profileSidebarFillColor
public final java.lang.String profileTextColor
public final boolean protectedUser
public final java.lang.String screenName
Twitter.CASE_SENSITIVE_SCREENNAMES
public final Status status
public final int statusesCount
public final java.lang.String timezone
public final double timezoneOffSet
public final boolean verified
public final java.net.URI website
public User(com.winterwell.json.JSONObject obj, Status status) throws TwitterException
obj
- status
- can be nullTwitterException
public User(java.lang.String screenName)
// Test whether jtwit is a friend
twitter.getFriends().contains(new User("jtwit"));
screenName
- This will be converted to lower-case as Twitter screen-names
are case insensitive (unless
Twitter.CASE_SENSITIVE_SCREENNAMES
is set)public java.lang.String getLang()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.util.Date getCreatedAt()
public java.lang.String getDescription()
public int getFavoritesCount()
public int getFollowersCount()
public int getFriendsCount()
public java.lang.Long getId()
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.
public java.lang.String getLocation()
location
,
getPlace()
public java.lang.String getName()
getScreenName()
public Place getPlace()
location
, but it is often null!public java.lang.String getProfileBackgroundColor()
public java.net.URI getProfileBackgroundImageUrl()
public java.net.URI getProfileImageUrl()
public java.lang.String getProfileLinkColor()
public java.lang.String getProfileSidebarBorderColor()
public java.lang.String getProfileSidebarFillColor()
public java.lang.String getProfileTextColor()
public boolean getProtectedUser()
public java.lang.String getScreenName()
public Status getStatus()
public int getStatusesCount()
public java.lang.String getTimezone()
public double getTimezoneOffSet()
public java.net.URI getWebsite()
public int hashCode()
hashCode
in class java.lang.Object
public boolean isDummyObject()
profileImageUrl
. Dummy User objects are
equals() to full User objects.public java.lang.Boolean isFollowedByYou()
public java.lang.Boolean isFollowingYou()
public boolean isNotifications()
public boolean isProfileBackgroundTile()
public boolean isProtectedUser()
public boolean isVerified()
public java.lang.String toString()
toString
in class java.lang.Object