Package com.restfb.types
Class User
- All Implemented Interfaces:
HasCover
,HasProfilePicture
,Serializable
Represents the User Graph API type.
- Since:
- 1.5
- Author:
- Mark Allen, Patrick Alberts
- See Also:
- Serialized Form
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Represents the Currency Graph API type.static class
Deprecated.since breaking change on 4 April, 2018static class
Represents the Class Graph API type.static class
static class
Represents the Payment Pricepoint Graph API type.static class
Represents the Payment Pricepoints Graph API type.static class
Represents the Secure Browsing Graph API type.static class
Represents the Security Settings Graph API typestatic class
Represents the Sport Graph API type.static class
Represents the Use">User Device Graph API type.static class
Represents the Video Upload Limits Graph API type.Nested classes/interfaces inherited from class com.restfb.types.FacebookType
FacebookType.Metadata
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addDevice(User.UserDevice device)
boolean
addEducation(User.Education educationHistoryItem)
Deprecated.since breaking change on 4 April, 2018boolean
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
addInterestedIn(String gender)
Deprecated.since breaking change on 4 April, 2018boolean
addInvitableFriend(UserInvitableFriend friend)
boolean
boolean
addLanguage(User.Experience language)
boolean
addMeetingFor(String gender)
boolean
addSport(User.Sport sportItem)
boolean
addWork(WorkExperience workHistoryItem)
Deprecated.since breaking change on 4 April, 2018getAbout()
Deprecated.since breaking change on 4 April, 2018Unspecific age range that this person's age fits into.getBio()
The user's biographical snippet.The user's birthday as aString
.The user's birthday, typed tojava.util.Date
if possible.Deprecated.with Graph API 12 or December 13, 2021 for all versionsgetCover()
The person's cover photoThe user's currency preferences.The list of devices the person is using.Deprecated.since breaking change on 4 April, 2018getEmail()
The proxied or contact email address granted by the user.A list of the favorite athletes from the user's profile.A list of the favorite sports teams from the user's profile.The user's first name.The user's gender.Duplicate mapping for "hometown" since FB can return it differently in different situations. -- GETTER -- The user's hometown.The user's hometown name.Businesses can claim ownership of multiple apps using Business Manager.Businesses can claim ownership of multiple apps using Business Manager.Businesses can claim ownership of apps and pages using Business Manager.The person's inspirational people.Is the app making the request installed?Install type.Deprecated.since breaking change on 4 April, 2018A list of friends that can be invited to install a Facebook Canvas appif the current user is a guest user. should always return false.Deprecated.Will be deprecated in all versions on Nov, 2020.People with large numbers of followers can have the authenticity of their identity manually verified by Facebook.Page labels of this userA list of the languages from the user's profile.The user's last name.getLikes()
The user's LikesgetLink()
A link to the user's profile.The user's locale.The user's current location.What genders the user is interested in meeting.The user's middle name.The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering.The person's payment pricepointsThe user's picture, if provided.Deprecated.since breaking change on 4 April, 2018The person's PGP public keyThe user's favorite quotes.Deprecated.since breaking change on 4 April, 2018Deprecated.since breaking change on 4 April, 2018Deprecated.Will be deprecated in all versions on Nov, 2020.The time that the shared loginneeds to be upgraded to Business Manager byShortened, locale-aware name for the person.The user's significant other.A list of the sports from the user's profile.Deprecated.Will be deprecated in all versions on Nov, 2020.An anonymous, but unique identifier for the user.The user's timezone offset.This returns a string which is the same for this person across all the apps managed by the same Business Manager.Date the user's profile was updated.Deprecated.since graph api 2.0Indicates whether the account has been verified.Video upload limitsDeprecated.Will be deprecated in all versions on Nov, 2020.Deprecated.since breaking change on 4 April, 2018getWork()
Deprecated.since breaking change on 4 April, 2018protected void
jsonMappingCompleted(JsonMapper jsonMapper)
boolean
removeDevice(User.UserDevice device)
boolean
removeEducation(User.Education educationHistoryItem)
Deprecated.since breaking change on 4 April, 2018boolean
removeFavoriteAthlete(User.Experience athlet)
boolean
boolean
removeIdsForApps(UserIDForApp userId)
boolean
removeIdsForBusiness(UserIDForApp userId)
boolean
removeIdsForPages(UserIDForPage userId)
boolean
removeInspirationalPeople(User.Experience person)
boolean
removeInterestedIn(String gender)
Deprecated.since breaking change on 4 April, 2018boolean
removeInvitableFriend(UserInvitableFriend friend)
boolean
removeLabels(PageLabel label)
boolean
removeLanguage(User.Experience language)
boolean
removeMeetingFor(String gender)
boolean
removeSport(User.Sport sportItem)
boolean
removeWork(WorkExperience workHistoryItem)
Deprecated.since breaking change on 4 April, 2018void
Deprecated.since breaking change on 4 April, 2018void
setAgeRange(User.AgeRange ageRange)
Unspecific age range that this person's age fits into.void
The user's biographical snippet.void
setBirthday(String birthday)
The user's birthday as aString
.void
setContext(FacebookType context)
Deprecated.with Graph API 12 or December 13, 2021 for all versionsvoid
setCover(CoverPhoto cover)
The person's cover photovoid
setCurrency(User.Currency currency)
The user's currency preferences.void
The proxied or contact email address granted by the user.void
setFirstName(String firstName)
The user's first name.void
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
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
setIsSharedLogin(Boolean isSharedLogin)
Deprecated.Will be deprecated in all versions on Nov, 2020.void
setIsVerified(Boolean isVerified)
People with large numbers of followers can have the authenticity of their identity manually verified by Facebook.void
setLastName(String lastName)
The user's last name.void
The user's Likesvoid
A link to the user's profile.void
The user's locale.void
setLocation(NamedFacebookType location)
The user's current location.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
setPolitical(String political)
Deprecated.since breaking change on 4 April, 2018void
setPublicKey(String publicKey)
The person's PGP public keyvoid
The user's favorite quotes.void
setRelationshipStatus(String relationshipStatus)
Deprecated.since breaking change on 4 April, 2018void
setReligion(String religion)
Deprecated.since breaking change on 4 April, 2018void
setSecuritySettings(User.SecuritySettings securitySettings)
Deprecated.Will be deprecated in all versions on Nov, 2020.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(NamedFacebookType significantOther)
The user's significant other.void
setTestGroup(Long testGroup)
Deprecated.Will be deprecated in all versions on Nov, 2020.void
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
setUsername(String username)
Deprecated.since graph api 2.0void
setVerified(Boolean verified)
Indicates whether the account has been verified.void
setVideoUploadLimits(User.VideoUploadLimits videoUploadLimits)
Video upload limitsvoid
setViewerCanSendGift(Boolean viewerCanSendGift)
Deprecated.Will be deprecated in all versions on Nov, 2020.void
setWebsite(String website)
Deprecated.since breaking change on 4 April, 2018Methods 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 Details
-
User
public User()
-
-
Method Details
-
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
-
getHometownName
The user's hometown name.- Returns:
- The user's hometown name.
-
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
-
removeIdsForApps
-
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
-
removeIdsForBusiness
-
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
-
removeIdsForPages
-
getInterestedIn
Deprecated.since breaking change on 4 April, 2018The genders the user is interested in.- Returns:
- The genders the user is interested in.
-
addInterestedIn
Deprecated.since breaking change on 4 April, 2018Add a gender the user is interested in.- Parameters:
gender
- the gender that should be added- Returns:
true
if the gender could be added
-
removeInterestedIn
Deprecated.since breaking change on 4 April, 2018Remove a gender the user is interested in.- Parameters:
gender
- the gender that should be removed- Returns:
true
if the gender could be removed
-
getMeetingFor
What genders the user is interested in meeting.- Returns:
- What genders the user is interested in meeting.
-
addMeetingFor
-
removeMeetingFor
-
getWork
Deprecated.since breaking change on 4 April, 2018A list of the work history from the user's profile.- Returns:
- A list of the work history from the user's profile.
-
addWork
Deprecated.since breaking change on 4 April, 2018Adds theWorkExperience
from the work experience list- Parameters:
workHistoryItem
- the WorkExperience that should be added- Returns:
true
if theWorkExperience
could be added
-
removeWork
Deprecated.since breaking change on 4 April, 2018Removes theWorkExperience
from the work experience list- Parameters:
workHistoryItem
- the WorkExperience that should be removed- Returns:
true
if theWorkExperience
could be removed
-
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
-
removeDevice
-
getEducation
Deprecated.since breaking change on 4 April, 2018A list of the education history from the user's profile.- Returns:
- A list of the education history from the user's profile.
-
addEducation
Deprecated.since breaking change on 4 April, 2018Adds theUser.Education
from the education list- Parameters:
educationHistoryItem
- the Education that should be added- Returns:
true
if theUser.Education
could be added
-
removeEducation
Deprecated.since breaking change on 4 April, 2018Removes theUser.Education
from the education list- Parameters:
educationHistoryItem
- the Education that should be removed- Returns:
true
if theUser.Education
could be removed
-
getSports
A list of the sports from the user's profile.- Returns:
- A list of the sports from this user's profile.
-
addSport
-
removeSport
-
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
-
removeFavoriteTeam
-
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
-
removeFavoriteAthlete
-
getInspirationalPeople
The person's inspirational people.- Returns:
- The person's inspirational people.
-
addInspirationalPeople
-
removeInspirationalPeople
-
getLanguages
A list of the languages from the user's profile.- Returns:
- A list of the languages from the user's profile.
-
addLanguage
-
removeLanguage
-
getLabels
Page labels of this user- Returns:
- labels of this user
-
addLabel
-
removeLabels
-
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
-
removeInvitableFriend
-
getContext
Deprecated.with Graph API 12 or December 13, 2021 for all versionsSocial context for this person- Returns:
- Social context for this person
-
setContext
Deprecated.with Graph API 12 or December 13, 2021 for all versionsSocial context for this person -
getFirstName
The user's first name.- Returns:
- The user's first name.
-
setFirstName
The user's first name. -
getMiddleName
The user's middle name.- Returns:
- The user's middle name.
-
setMiddleName
The user's middle name. -
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
The person's name formatted to correctly handle Chinese, Japanese, or Korean ordering. -
getPaymentPricepoints
The person's payment pricepoints- Returns:
- The person's payment pricepoints
-
setPaymentPricepoints
The person's payment pricepoints -
getLastName
The user's last name.- Returns:
- The user's last name.
-
setLastName
The user's last name. -
getShortName
Shortened, locale-aware name for the person.- Returns:
- Shortened, locale-aware name for the person
-
setShortName
Shortened, locale-aware name for the person. -
getCover
The person's cover photo -
setCover
The person's cover photo -
getLink
A link to the user's profile.- Returns:
- A link to the user's profile.
-
setLink
A link to the user's profile. -
getBio
The user's biographical snippet.- Returns:
- The user's biographical snippet.
-
setBio
The user's biographical snippet. -
getQuotes
The user's favorite quotes.- Returns:
- The user's favorite quotes.
-
setQuotes
The user's favorite quotes. -
getAbout
Deprecated.since breaking change on 4 April, 2018The user's blurb that appears under their profile picture.- Returns:
- The user's blurb that appears under their profile picture.
-
setAbout
Deprecated.since breaking change on 4 April, 2018The user's blurb that appears under their profile picture. -
getRelationshipStatus
Deprecated.since breaking change on 4 April, 2018The user's relationship status.- Returns:
- The user's relationship status.
-
setRelationshipStatus
Deprecated.since breaking change on 4 April, 2018The user's relationship status. -
getReligion
Deprecated.since breaking change on 4 April, 2018The user's religion.- Returns:
- The user's religion.
-
setReligion
Deprecated.since breaking change on 4 April, 2018The user's religion. -
getAgeRange
Unspecific age range that this person's age fits into.- Returns:
- The user's age range
-
setAgeRange
Unspecific age range that this person's age fits into. -
getWebsite
Deprecated.since breaking change on 4 April, 2018A link to the user's personal website.- Returns:
- A link to the user's personal website.
-
setWebsite
Deprecated.since breaking change on 4 April, 2018A link to the user's personal website. -
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.- Returns:
- The user's birthday as a
String
.
-
setBirthday
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. -
getEmail
The proxied or contact email address granted by the user.- Returns:
- The proxied or contact email address granted by the user.
-
setEmail
The proxied or contact email address granted by the user. -
getTimezone
The user's timezone offset.- Returns:
- The user's timezone offset.
-
setTimezone
The user's timezone offset. -
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
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
Video upload limits- Returns:
- Video upload limits
-
setVideoUploadLimits
Video upload limits -
getViewerCanSendGift
Deprecated.Will be deprecated in all versions on Nov, 2020.Can the viewer send a gift to this person?- Returns:
- Can the viewer send a gift to this person?
-
setViewerCanSendGift
Deprecated.Will be deprecated in all versions on Nov, 2020.Can the viewer send a gift to this person? -
getGender
The user's gender.- Returns:
- The user's gender.
-
setGender
The user's gender. -
getPolitical
Deprecated.since breaking change on 4 April, 2018The user's political affiliation.- Returns:
- The user's political affiliation.
-
setPolitical
Deprecated.since breaking change on 4 April, 2018The user's political affiliation. -
getLocale
The user's locale.- Returns:
- The user's locale.
-
setLocale
The user's locale. -
getUsername
Deprecated.since graph api 2.0The user's Facebook username.- Returns:
- The user's Facebook username.
- Since:
- 1.6.5
-
setUsername
Deprecated.since graph api 2.0The user's Facebook username.- Since:
- 1.6.5
-
getPublicKey
The person's PGP public key- Returns:
- The person's PGP public key
-
setPublicKey
The person's PGP public key -
getLikes
The user's Likes- Returns:
- the user's Likes
-
setLikes
The user's Likes -
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
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
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
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. -
getLocation
The user's current location.- Returns:
- The user's current location.
-
setLocation
The user's current location. -
getSecuritySettings
Deprecated.Will be deprecated in all versions on Nov, 2020.Security settings- Returns:
- Security settings
-
setSecuritySettings
Deprecated.Will be deprecated in all versions on Nov, 2020.Security settings -
getSignificantOther
The user's significant other.- Returns:
- The user's significant other.
-
setSignificantOther
The user's significant other. -
getTestGroup
Deprecated.Will be deprecated in all versions on Nov, 2020.Platform test group- Returns:
- Platform test group
-
setTestGroup
Deprecated.Will be deprecated in all versions on Nov, 2020.Platform test group -
getUpdatedTime
Date the user's profile was updated.- Returns:
- Date the user's profile was updated.
-
setUpdatedTime
Date the user's profile was updated. -
getThirdPartyId
An anonymous, but unique identifier for the user.- Returns:
- An anonymous, but unique identifier for the user.
-
setThirdPartyId
An anonymous, but unique identifier for the user. -
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
The user's currency preferences.Further documentation available on Facebook's Displaying prices in user's currency page.
- Since:
- 1.6.12
-
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
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
Install type.- Returns:
- Install type.
-
setInstallType
Install type. -
getInstalled
Is the app making the request installed?- Returns:
- Is the app making the request installed?
-
setInstalled
Is the app making the request installed? -
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
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 -
getIsGuestUser
if the current user is a guest user. should always return false. -
setIsGuestUser
if the current user is a guest user. should always return false.
-