winterwell.jtwitter
Class Twitter.User

java.lang.Object
  extended by winterwell.jtwitter.Twitter.User
Enclosing class:
Twitter

public static final class Twitter.User
extends java.lang.Object

A Twitter user. Fields are null if unset.


Field Summary
 java.util.Date createdAt
           
 java.lang.String description
           
 int favoritesCount
           
 int followersCount
           
 boolean following
          Is this person following you?
 boolean followRequestSent
          True if the user you are authenticating as has requested to follow this user.
 int friendsCount
          number of people this user is following
 long id
           
 int listedCount
          The number of public lists a user is listed in.
 java.lang.String location
           
 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.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.
 Twitter.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 Summary
Twitter.User(java.lang.String screenName)
          Create a dummy User object.
 
Method Summary
 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()
           
 long getId()
           
 java.lang.String getLocation()
           
 java.lang.String getName()
          The display name, e.g.
 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.
 Twitter.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()
           
 boolean isFollowing()
          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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

description

public final java.lang.String description

id

public final long id

location

public final java.lang.String location

name

public final java.lang.String name
The display name, e.g. "Daniel Winterstein"


profileImageUrl

public java.net.URI profileImageUrl
The url for the user's Twitter profile picture.

Note: we allow this to be edited as a convenience for the User objects generated by search


protectedUser

public final boolean protectedUser
true if this user keeps their updates private


screenName

public final java.lang.String screenName
The login name, e.g. "winterstein" This is the only thing used by equals() and hashcode(). This is always lower-case, as Twitter screen-names are case insensitive.


status

public final Twitter.Status status
The user's current status - *if* returned by Twitter. Not all calls return this, so can be null.


website

public final java.net.URI website

timezoneOffSet

public final double timezoneOffSet
Number of seconds between a user's registered time zone and Greenwich Mean Time (GMT) - aka Coordinated Universal Time or UTC. Can be positive or negative.


timezone

public final java.lang.String timezone

followersCount

public int followersCount

profileBackgroundColor

public final java.lang.String profileBackgroundColor

profileLinkColor

public final java.lang.String profileLinkColor

profileTextColor

public final java.lang.String profileTextColor

profileSidebarFillColor

public final java.lang.String profileSidebarFillColor

profileSidebarBorderColor

public final java.lang.String profileSidebarBorderColor

friendsCount

public final int friendsCount
number of people this user is following


createdAt

public final java.util.Date createdAt

favoritesCount

public final int favoritesCount

profileBackgroundImageUrl

public final java.net.URI profileBackgroundImageUrl

profileBackgroundTile

public final boolean profileBackgroundTile

statusesCount

public final int statusesCount

notifications

public final boolean notifications

verified

public final boolean verified

following

public final boolean following
Is this person following you?


followRequestSent

public final boolean followRequestSent
True if the user you are authenticating as has requested to follow this user. This will be false unless the friendship request is pending. False if Twitter does not say otherwise.


listedCount

public final int listedCount
The number of public lists a user is listed in. -1 if unknown.

Constructor Detail

Twitter.User

public Twitter.User(java.lang.String screenName)
Create a dummy User object. All fields are set to null. This will be equals() to an actual User object, so it can be used to query collections. E.g.
 // Test whether jtwit is a friend
 twitter.getFriends().contains(new User("jtwit"));
 

Parameters:
screenName - This will be converted to lower-case as Twitter screen-names are case insensitive
Method Detail

equals

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

getCreatedAt

public java.util.Date getCreatedAt()

getDescription

public java.lang.String getDescription()

getFavoritesCount

public int getFavoritesCount()
Number of statuses a user has marked as favorite.
Warning: can be zero if Twitter did not supply the info (e.g. User objects from searches or RSS feeds)


getFollowersCount

public int getFollowersCount()
Returns:
Number of followers.
Warning: can be zero if Twitter did not supply the info (e.g. User objects from searches or RSS feeds)

getFriendsCount

public int getFriendsCount()
Returns:
number of people this user is following.
Warning: can be zero if Twitter did not supply the info (e.g. User objects from searches or RSS feeds)

getId

public long getId()

getLocation

public java.lang.String getLocation()

getName

public java.lang.String getName()
The display name, e.g. "Daniel Winterstein"

See Also:
getScreenName()

getProfileBackgroundColor

public java.lang.String getProfileBackgroundColor()

getProfileBackgroundImageUrl

public java.net.URI getProfileBackgroundImageUrl()

getProfileImageUrl

public java.net.URI getProfileImageUrl()

getProfileLinkColor

public java.lang.String getProfileLinkColor()

getProfileSidebarBorderColor

public java.lang.String getProfileSidebarBorderColor()

getProfileSidebarFillColor

public java.lang.String getProfileSidebarFillColor()

getProfileTextColor

public java.lang.String getProfileTextColor()

getProtectedUser

public boolean getProtectedUser()

getScreenName

public java.lang.String getScreenName()
The login name, e.g. "winterstein". Never null


getStatus

public Twitter.Status getStatus()
The user's current status - *if* returned by Twitter. Not all calls return this, so can be null.


getStatusesCount

public int getStatusesCount()
Returns:
number of status updates posted by this User.
Warning: can be zero if Twitter did not supply the info (e.g. User objects from searches or RSS feeds)

getTimezone

public java.lang.String getTimezone()
String version of the timezone


getTimezoneOffSet

public double getTimezoneOffSet()
Number of seconds between a user's registered time zone and Greenwich Mean Time (GMT) - aka Coordinated Universal Time or UTC. Can be positive or negative.


getWebsite

public java.net.URI getWebsite()

hashCode

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

isDummyObject

public boolean isDummyObject()
Returns:
true if this is a dummy User object, in which case almost all of it's fields will be null - with the exception of screenName and possibly profileImageUrl. Dummy User objects are equals() to full User objects.

isFollowing

public boolean isFollowing()
Is this person following you?


isNotifications

public boolean isNotifications()

isProfileBackgroundTile

public boolean isProfileBackgroundTile()

isProtectedUser

public boolean isProtectedUser()
true if this user keeps their updates private


isVerified

public boolean isVerified()
Returns:
true if the account has been verified by Twitter to really be who it claims to be.

toString

public java.lang.String toString()
Returns the User's screenName (i.e. their Twitter login)

Overrides:
toString in class java.lang.Object