Class User
-
- All Implemented Interfaces:
HasCover
,HasProfilePicture
,Serializable
public class User extends NamedFacebookType implements HasProfilePicture, HasCover
Represents the User Graph API type.- Since:
- 1.5
- Author:
- Mark Allen, Patrick Alberts
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
User.AgeRange
static class
User.Currency
Represents the Currency Graph API type.static class
User.Experience
static class
User.PaymentPricepoint
Represents the Payment Pricepoint Graph API type.static class
User.PaymentPricepoints
Represents the Payment Pricepoints Graph API type.static class
User.SecureBrowsing
Represents the Secure Browsing Graph API type.static class
User.Sport
Represents the Sport Graph API type.static class
User.UserDevice
Represents the User Device Graph API type.static class
User.VideoUploadLimits
Represents the Video Upload Limits Graph API type.-
Nested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata
-
-
Constructor Summary
Constructors Constructor Description User()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addDevice(User.UserDevice device)
boolean
addFavoriteAthlete(User.Experience athlet)
boolean
addFavoriteTeam(User.Experience team)
boolean
addIdsForApps(UserIDForApp userId)
boolean
addIdsForBusiness(UserIDForApp userId)
boolean
addIdsForPages(UserIDForPage userId)
boolean
addInspirationalPeople(User.Experience person)
boolean
addInvitableFriend(UserInvitableFriend friend)
boolean
addLabel(PageLabel label)
boolean
addLanguage(User.Experience language)
boolean
addMeetingFor(String gender)
boolean
addSport(User.Sport sportItem)
User.AgeRange
getAgeRange()
Unspecific age range that this person's age fits into.String
getBio()
The user's biographical snippet.String
getBirthday()
The user's birthday as aString
.Date
getBirthdayAsDate()
The user's birthday, typed tojava.util.Date
if possible.FacebookType
getContext()
Social context for this personCoverPhoto
getCover()
The person's cover photoUser.Currency
getCurrency()
The user's currency preferences.List<User.UserDevice>
getDevices()
The list of devices the person is using.String
getEmail()
The proxied or contact email address granted by the user.List<User.Experience>
getFavoriteAthletes()
A list of the favorite athletes from the user's profile.List<User.Experience>
getFavoriteTeams()
A list of the favorite sports teams from the user's profile.String
getFirstName()
The user's first name.String
getGender()
The user's gender.NamedFacebookType
getHometown()
Duplicate mapping for "hometown" since FB can return it differently in different situations. -- GETTER -- The user's hometown.String
getHometownName()
The user's hometown name.String
getIdForAvatars()
A profile based app scoped ID.List<UserIDForApp>
getIdsForApps()
Businesses can claim ownership of multiple apps using Business Manager.List<UserIDForApp>
getIdsForBusiness()
Businesses can claim ownership of multiple apps using Business Manager.List<UserIDForPage>
getIdsForPages()
Businesses can claim ownership of apps and pages using Business Manager.List<User.Experience>
getInspirationalPeople()
The person's inspirational people.Boolean
getInstalled()
Is the app making the request installed?String
getInstallType()
Install type.List<UserInvitableFriend>
getInvitableFriends()
A list of friends that can be invited to install a Facebook Canvas appBoolean
getIsGuestUser()
if the current user is a guest user. should always return false.Boolean
getIsVerified()
People with large numbers of followers can have the authenticity of their identity manually verified by Facebook.Boolean
getIsWorkAccount()
List<PageLabel>
getLabels()
Page labels of this userList<User.Experience>
getLanguages()
A list of the languages from the user's profile.String
getLastName()
The user's last name.Likes
getLikes()
The user's LikesString
getLink()
A link to the person's Timeline.String
getLocale()
The user's locale.NamedFacebookType
getLocation()
he person's current location as entered by them on their profile.List<String>
getMeetingFor()
What genders the user is interested in meeting.String
getMiddleName()
The user's middle name.String
getNameFormat()
The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering.User.PaymentPricepoints
getPaymentPricepoints()
The person's payment pricepointsProfilePictureSource
getPicture()
The user's picture, if provided.String
getPublicKey()
The person's PGP public keyString
getQuotes()
The user's favorite quotes.Date
getSharedLoginUpgradeRequiredBy()
The time that the shared loginneeds to be upgraded to Business Manager byString
getShortName()
Shortened, locale-aware name for the person.User
getSignificantOther()
The user's significant other.List<User.Sport>
getSports()
A list of the sports from the user's profile.Boolean
getSupportsDonateButtonInLiveVideo()
Whether the user can add a Donate Button to their Live VideosString
getThirdPartyId()
An anonymous, but unique identifier for the user.Double
getTimezone()
The user's timezone offset.String
getTokenForBusiness()
This returns a string which is the same for this person across all the apps managed by the same Business Manager.Date
getUpdatedTime()
Date the user's profile was updated.Boolean
getVerified()
Indicates whether the account has been verified.User.VideoUploadLimits
getVideoUploadLimits()
Video upload limitsprotected void
jsonMappingCompleted(JsonMapper jsonMapper)
boolean
removeDevice(User.UserDevice device)
boolean
removeFavoriteAthlete(User.Experience athlet)
boolean
removeFavoriteTeam(User.Experience team)
boolean
removeIdsForApps(UserIDForApp userId)
boolean
removeIdsForBusiness(UserIDForApp userId)
boolean
removeIdsForPages(UserIDForPage userId)
boolean
removeInspirationalPeople(User.Experience person)
boolean
removeInvitableFriend(UserInvitableFriend friend)
boolean
removeLabels(PageLabel label)
boolean
removeLanguage(User.Experience language)
boolean
removeMeetingFor(String gender)
boolean
removeSport(User.Sport sportItem)
void
setAgeRange(User.AgeRange ageRange)
Unspecific age range that this person's age fits into.void
setBio(String bio)
The user's biographical snippet.void
setBirthday(String birthday)
The user's birthday as aString
.void
setContext(FacebookType context)
Social context for this personvoid
setCover(CoverPhoto cover)
The person's cover photovoid
setCurrency(User.Currency currency)
The user's currency preferences.void
setEmail(String email)
The proxied or contact email address granted by the user.void
setFirstName(String firstName)
The user's first name.void
setGender(String gender)
The user's gender.void
setHometown(NamedFacebookType hometown)
Duplicate mapping for "hometown" since FB can return it differently in different situations. -- GETTER -- The user's hometown.void
setIdForAvatars(String idForAvatars)
A profile based app scoped ID.void
setInstalled(Boolean installed)
Is the app making the request installed?void
setInstallType(String installType)
Install type.void
setIsGuestUser(Boolean isGuestUser)
if the current user is a guest user. should always return false.void
setIsVerified(Boolean isVerified)
People with large numbers of followers can have the authenticity of their identity manually verified by Facebook.void
setIsWorkAccount(Boolean isWorkAccount)
void
setLastName(String lastName)
The user's last name.void
setLikes(Likes likes)
The user's Likesvoid
setLink(String link)
A link to the person's Timeline.void
setLocale(String locale)
The user's locale.void
setLocation(NamedFacebookType location)
he person's current location as entered by them on their profile.void
setMiddleName(String middleName)
The user's middle name.void
setNameFormat(String nameFormat)
The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering.void
setPaymentPricepoints(User.PaymentPricepoints paymentPricepoints)
The person's payment pricepointsvoid
setPicture(ProfilePictureSource picture)
The user's picture, if provided.void
setPublicKey(String publicKey)
The person's PGP public keyvoid
setQuotes(String quotes)
The user's favorite quotes.void
setSharedLoginUpgradeRequiredBy(Date sharedLoginUpgradeRequiredBy)
The time that the shared loginneeds to be upgraded to Business Manager byvoid
setShortName(String shortName)
Shortened, locale-aware name for the person.void
setSignificantOther(User significantOther)
The user's significant other.void
setSupportsDonateButtonInLiveVideo(Boolean supportsDonateButtonInLiveVideo)
Whether the user can add a Donate Button to their Live Videosvoid
setThirdPartyId(String thirdPartyId)
An anonymous, but unique identifier for the user.void
setTimezone(Double timezone)
The user's timezone offset.void
setTokenForBusiness(String tokenForBusiness)
This returns a string which is the same for this person across all the apps managed by the same Business Manager.void
setUpdatedTime(Date updatedTime)
Date the user's profile was updated.void
setVerified(Boolean verified)
Indicates whether the account has been verified.void
setVideoUploadLimits(User.VideoUploadLimits videoUploadLimits)
Video upload limits-
Methods inherited from class com.restfb.types.NamedFacebookType
getName, setName
-
Methods inherited from class com.restfb.types.FacebookType
getId, getMetadata, getType, setId, setMetadata, setType
-
Methods inherited from class com.restfb.types.AbstractFacebookType
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.restfb.types.features.HasProfilePicture
convertPicture
-
-
-
-
Constructor Detail
-
User
public User()
-
-
Method Detail
-
getBirthdayAsDate
public Date getBirthdayAsDate()
The user's birthday, typed tojava.util.Date
if possible.- Returns:
- The user's birthday, or
null
if unavailable or only available in month/year format.
-
jsonMappingCompleted
protected void jsonMappingCompleted(JsonMapper jsonMapper)
-
getHometownName
public String getHometownName()
The user's hometown name.- Returns:
- The user's hometown name.
-
getIdsForApps
public List<UserIDForApp> getIdsForApps()
Businesses can claim ownership of multiple apps using Business Manager. This method returns the list of IDs that this user has in any of those other apps- Returns:
- list of ids a user has in other apps
-
addIdsForApps
public boolean addIdsForApps(UserIDForApp userId)
-
removeIdsForApps
public boolean removeIdsForApps(UserIDForApp userId)
-
getIdsForBusiness
public List<UserIDForApp> getIdsForBusiness()
Businesses can claim ownership of multiple apps using Business Manager. This edge returns the list of IDs that this user has in any of those other apps- Returns:
- list of ids a user has in other apps
-
addIdsForBusiness
public boolean addIdsForBusiness(UserIDForApp userId)
-
removeIdsForBusiness
public boolean removeIdsForBusiness(UserIDForApp userId)
-
getIdsForPages
public List<UserIDForPage> getIdsForPages()
Businesses can claim ownership of apps and pages using Business Manager. This edge returns the list of IDs that this user has in any of the pages owned by this business.- Returns:
- list of ids a user has in other pages
-
addIdsForPages
public boolean addIdsForPages(UserIDForPage userId)
-
removeIdsForPages
public boolean removeIdsForPages(UserIDForPage userId)
-
getMeetingFor
public List<String> getMeetingFor()
What genders the user is interested in meeting.- Returns:
- What genders the user is interested in meeting.
-
addMeetingFor
public boolean addMeetingFor(String gender)
-
removeMeetingFor
public boolean removeMeetingFor(String gender)
-
getDevices
public List<User.UserDevice> getDevices()
The list of devices the person is using. This will return only iOS and Android devices- Returns:
- The list of devices the person is using.
-
addDevice
public boolean addDevice(User.UserDevice device)
-
removeDevice
public boolean removeDevice(User.UserDevice device)
-
getSports
public List<User.Sport> getSports()
A list of the sports from the user's profile.- Returns:
- A list of the sports from this user's profile.
-
addSport
public boolean addSport(User.Sport sportItem)
-
removeSport
public boolean removeSport(User.Sport sportItem)
-
getFavoriteTeams
public List<User.Experience> getFavoriteTeams()
A list of the favorite sports teams from the user's profile.- Returns:
- A list of the favorite sports teams from the user's profile.
-
addFavoriteTeam
public boolean addFavoriteTeam(User.Experience team)
-
removeFavoriteTeam
public boolean removeFavoriteTeam(User.Experience team)
-
getFavoriteAthletes
public List<User.Experience> getFavoriteAthletes()
A list of the favorite athletes from the user's profile.- Returns:
- A list of the favorite athletes from the user's profile.
-
addFavoriteAthlete
public boolean addFavoriteAthlete(User.Experience athlet)
-
removeFavoriteAthlete
public boolean removeFavoriteAthlete(User.Experience athlet)
-
getInspirationalPeople
public List<User.Experience> getInspirationalPeople()
The person's inspirational people.- Returns:
- The person's inspirational people.
-
addInspirationalPeople
public boolean addInspirationalPeople(User.Experience person)
-
removeInspirationalPeople
public boolean removeInspirationalPeople(User.Experience person)
-
getLanguages
public List<User.Experience> getLanguages()
A list of the languages from the user's profile.- Returns:
- A list of the languages from the user's profile.
-
addLanguage
public boolean addLanguage(User.Experience language)
-
removeLanguage
public boolean removeLanguage(User.Experience language)
-
getLabels
@GraphAPI(since="2.6") public List<PageLabel> getLabels()
Page labels of this user- Returns:
- labels of this user
-
removeLabels
public boolean removeLabels(PageLabel label)
-
getInvitableFriends
public List<UserInvitableFriend> getInvitableFriends()
A list of friends that can be invited to install a Facebook Canvas app- Returns:
- A list of friends that can be invited to install a Facebook Canvas app
-
addInvitableFriend
public boolean addInvitableFriend(UserInvitableFriend friend)
-
removeInvitableFriend
public boolean removeInvitableFriend(UserInvitableFriend friend)
-
getContext
public FacebookType getContext()
Social context for this person- Returns:
- Social context for this person
-
setContext
public void setContext(FacebookType context)
Social context for this person
-
getFirstName
public String getFirstName()
The user's first name.- Returns:
- The user's first name.
-
setFirstName
public void setFirstName(String firstName)
The user's first name.
-
getMiddleName
public String getMiddleName()
The user's middle name.- Returns:
- The user's middle name.
-
setMiddleName
public void setMiddleName(String middleName)
The user's middle name.
-
getNameFormat
public String getNameFormat()
The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering.- Returns:
- The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering
-
setNameFormat
public void setNameFormat(String nameFormat)
The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering.
-
getPaymentPricepoints
public User.PaymentPricepoints getPaymentPricepoints()
The person's payment pricepoints- Returns:
- The person's payment pricepoints
-
setPaymentPricepoints
public void setPaymentPricepoints(User.PaymentPricepoints paymentPricepoints)
The person's payment pricepoints
-
getLastName
public String getLastName()
The user's last name.- Returns:
- The user's last name.
-
setLastName
public void setLastName(String lastName)
The user's last name.
-
getShortName
@GraphAPI(since="2.9") public String getShortName()
Shortened, locale-aware name for the person.- Returns:
- Shortened, locale-aware name for the person
-
setShortName
public void setShortName(String shortName)
Shortened, locale-aware name for the person.
-
getCover
public CoverPhoto getCover()
The person's cover photo
-
setCover
public void setCover(CoverPhoto cover)
The person's cover photo
-
getLink
public String getLink()
A link to the person's Timeline. The link will only resolve if the person clicking the link is logged into Facebook and is a friend of the person whose profile is being viewed.- Returns:
- A link to the user's profile.
-
setLink
public void setLink(String link)
A link to the person's Timeline. The link will only resolve if the person clicking the link is logged into Facebook and is a friend of the person whose profile is being viewed.
-
getBio
@GraphAPI(until="2.7") public String getBio()
The user's biographical snippet.- Returns:
- The user's biographical snippet.
-
getQuotes
public String getQuotes()
The user's favorite quotes.- Returns:
- The user's favorite quotes.
-
getAgeRange
public User.AgeRange getAgeRange()
Unspecific age range that this person's age fits into.- Returns:
- The user's age range
-
setAgeRange
public void setAgeRange(User.AgeRange ageRange)
Unspecific age range that this person's age fits into.
-
getBirthday
public String getBirthday()
The user's birthday as aString
.Will always succeed, even if the user has specified month/year format only. If you'd like to use a typed version of this accessor, call
getBirthdayAsDate()
instead. "The person's birthday. This is a fixed format string, like `MM/DD/YYYY`. However, people can control who can see the year they were born separately from the month and day so this string can be only the year (YYYY) or the month + day (MM/DD)",- Returns:
- The user's birthday as a
String
.
-
setBirthday
public void setBirthday(String birthday)
The user's birthday as aString
.Will always succeed, even if the user has specified month/year format only. If you'd like to use a typed version of this accessor, call
getBirthdayAsDate()
instead. "The person's birthday. This is a fixed format string, like `MM/DD/YYYY`. However, people can control who can see the year they were born separately from the month and day so this string can be only the year (YYYY) or the month + day (MM/DD)",
-
getEmail
public String getEmail()
The proxied or contact email address granted by the user.- Returns:
- The proxied or contact email address granted by the user.
-
setEmail
public void setEmail(String email)
The proxied or contact email address granted by the user.
-
getTimezone
public Double getTimezone()
The user's timezone offset.- Returns:
- The user's timezone offset.
-
setTimezone
public void setTimezone(Double timezone)
The user's timezone offset.
-
getVerified
public Boolean getVerified()
Indicates whether the account has been verified. This is distinct from theis_verified
field. Someone is considered verified if they take any of the following actions:- Register for mobile
- Confirm their account via SMS
- Enter a valid credit card
- Returns:
- User verification status.
-
setVerified
public void setVerified(Boolean verified)
Indicates whether the account has been verified. This is distinct from theis_verified
field. Someone is considered verified if they take any of the following actions:- Register for mobile
- Confirm their account via SMS
- Enter a valid credit card
-
getVideoUploadLimits
public User.VideoUploadLimits getVideoUploadLimits()
Video upload limits- Returns:
- Video upload limits
-
setVideoUploadLimits
public void setVideoUploadLimits(User.VideoUploadLimits videoUploadLimits)
Video upload limits
-
getPublicKey
public String getPublicKey()
The person's PGP public key- Returns:
- The person's PGP public key
-
setPublicKey
public void setPublicKey(String publicKey)
The person's PGP public key
-
getPicture
public ProfilePictureSource getPicture()
The user's picture, if provided. To force Facebook to fill thepicture
field you have to fetch the user with thefields=picture
parameter, otherwise the picture isnull
.- Specified by:
getPicture
in interfaceHasProfilePicture
- Returns:
- the user's picture as ProfilePictureSource object
- Since:
- 1.6.16
-
setPicture
public void setPicture(ProfilePictureSource picture)
The user's picture, if provided. To force Facebook to fill thepicture
field you have to fetch the user with thefields=picture
parameter, otherwise the picture isnull
.- Since:
- 1.6.16
-
getHometown
public NamedFacebookType getHometown()
Duplicate mapping for "hometown" since FB can return it differently in different situations. -- GETTER -- The user's hometown.Sometimes this can be
null
- checkgetHometownName()
instead in that case.- Returns:
- The user's hometown.
-
setHometown
public void setHometown(NamedFacebookType hometown)
Duplicate mapping for "hometown" since FB can return it differently in different situations. -- GETTER -- The user's hometown.Sometimes this can be
null
- checkgetHometownName()
instead in that case.
-
getIdForAvatars
public String getIdForAvatars()
A profile based app scoped ID. It is used to query avatars
-
setIdForAvatars
public void setIdForAvatars(String idForAvatars)
A profile based app scoped ID. It is used to query avatars
-
getLocation
public NamedFacebookType getLocation()
he person's current location as entered by them on their profile. This field requires the `user_location` permission.- Returns:
- The user's current location.
-
setLocation
public void setLocation(NamedFacebookType location)
he person's current location as entered by them on their profile. This field requires the `user_location` permission.
-
getSharedLoginUpgradeRequiredBy
public Date getSharedLoginUpgradeRequiredBy()
The time that the shared loginneeds to be upgraded to Business Manager by- Returns:
- The time that the shared loginneeds to be upgraded to Business Manager by
-
setSharedLoginUpgradeRequiredBy
public void setSharedLoginUpgradeRequiredBy(Date sharedLoginUpgradeRequiredBy)
The time that the shared loginneeds to be upgraded to Business Manager by
-
getSignificantOther
public User getSignificantOther()
The user's significant other.- Returns:
- The user's significant other.
-
setSignificantOther
public void setSignificantOther(User significantOther)
The user's significant other.
-
getSupportsDonateButtonInLiveVideo
public Boolean getSupportsDonateButtonInLiveVideo()
Whether the user can add a Donate Button to their Live Videos
-
setSupportsDonateButtonInLiveVideo
public void setSupportsDonateButtonInLiveVideo(Boolean supportsDonateButtonInLiveVideo)
Whether the user can add a Donate Button to their Live Videos
-
getUpdatedTime
public Date getUpdatedTime()
Date the user's profile was updated.- Returns:
- Date the user's profile was updated.
-
setUpdatedTime
public void setUpdatedTime(Date updatedTime)
Date the user's profile was updated.
-
getThirdPartyId
public String getThirdPartyId()
An anonymous, but unique identifier for the user.- Returns:
- An anonymous, but unique identifier for the user.
-
setThirdPartyId
public void setThirdPartyId(String thirdPartyId)
An anonymous, but unique identifier for the user.
-
getCurrency
public User.Currency getCurrency()
The user's currency preferences.Further documentation available on Facebook's Displaying prices in user's currency page.
- Returns:
- The user's currency preferences.
- Since:
- 1.6.12
-
setCurrency
public void setCurrency(User.Currency currency)
The user's currency preferences.Further documentation available on Facebook's Displaying prices in user's currency page.
- Since:
- 1.6.12
-
getTokenForBusiness
public String getTokenForBusiness()
This returns a string which is the same for this person across all the apps managed by the same Business Manager.- Returns:
- string which is the same for a person across all apps managed by one company
- Since:
- 1.7.0
-
setTokenForBusiness
public void setTokenForBusiness(String tokenForBusiness)
This returns a string which is the same for this person across all the apps managed by the same Business Manager.- Since:
- 1.7.0
-
getInstallType
public String getInstallType()
Install type.- Returns:
- Install type.
-
setInstallType
public void setInstallType(String installType)
Install type.
-
getInstalled
public Boolean getInstalled()
Is the app making the request installed?- Returns:
- Is the app making the request installed?
-
setInstalled
public void setInstalled(Boolean installed)
Is the app making the request installed?
-
getIsVerified
public Boolean getIsVerified()
People with large numbers of followers can have the authenticity of their identity manually verified by Facebook. This field indicates whether the person's profile is verified in this way. This is distinct from theverified
field- Returns:
- Is the user verified
-
setIsVerified
public void setIsVerified(Boolean isVerified)
People with large numbers of followers can have the authenticity of their identity manually verified by Facebook. This field indicates whether the person's profile is verified in this way. This is distinct from theverified
field
-
getIsWorkAccount
public Boolean getIsWorkAccount()
-
setIsWorkAccount
public void setIsWorkAccount(Boolean isWorkAccount)
-
getIsGuestUser
public Boolean getIsGuestUser()
if the current user is a guest user. should always return false.
-
setIsGuestUser
public void setIsGuestUser(Boolean isGuestUser)
if the current user is a guest user. should always return false.
-
-