Package com.restfb.types
Class Post.FeedTargeting
- java.lang.Object
-
- com.restfb.types.AbstractFacebookType
-
- com.restfb.types.Post.Targeting
-
- com.restfb.types.Post.FeedTargeting
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Post
public static class Post.FeedTargeting extends Post.Targeting
Object that controls news feed targeting for this post. Anyone in these groups will be more likely to see this post, others will be less likely, but may still see it anyway. Any of the targeting fields shown here can be used, none are required (applies to Pages only). Represents the Feed Targeting API type.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.restfb.types.Post.Targeting
cities, countries, locales, regions
-
-
Constructor Summary
Constructors Constructor Description FeedTargeting()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addCollegeMajor(String collegeMajor)
boolean
addCollegeNetwork(FacebookType collegeNetwork)
boolean
addCollegeYear(Integer collegeYear)
boolean
addEducationStatus(Integer educationStatus)
boolean
addFanOf(String interestId)
boolean
addGender(Integer gender)
boolean
addInterestedIn(Integer interest)
boolean
addInterests(String interest)
boolean
addRelationshipStatus(Integer relationshipStatus)
boolean
addWorkNetwork(NamedFacebookType workNetwork)
Integer
getAgeMax()
Maximum age.Integer
getAgeMin()
Must be 13 or higher.List<String>
getCollegeMajors()
Target people who majored in these college subjects.List<FacebookType>
getCollegeNetworks()
Colleges, for college graduates.List<Integer>
getCollegeYears()
Array of integers for graduation year from college.List<Integer>
getEducationStatuses()
Array of integers for targeting based on education level.List<String>
getFanOf()
List of object ids.List<Integer>
getGenders()
Target specific genders. 1 targets all male viewers and 2 females.List<Integer>
getInterestedIn()
Indicates targeting based on the 'interested in' field of the user profile.List<String>
getInterests()
Indicates targeting based on the 'interests' field of the user profile.List<Integer>
getRelationshipStatuses()
Array of integers for targeting based on relationship status.Date
getRelevantUntilTs()
List<NamedFacebookType>
getWorkNetworks()
Company, organization, or other workplace.boolean
removeCollegeMajor(String collegeMajor)
boolean
removeCollegeNetwork(FacebookType collegeNetwork)
boolean
removeCollegeYear(Integer collegeYear)
boolean
removeEducationStatus(Integer educationStatus)
boolean
removeFanOf(String interestId)
boolean
removeGender(Integer gender)
boolean
removeInterestedIn(Integer interest)
boolean
removeInterests(String interest)
boolean
removeRelationshipStatus(Integer relationshipStatus)
boolean
removeWorkNetwork(NamedFacebookType workNetwork)
void
setAgeMax(Integer ageMax)
Maximum age.void
setAgeMin(Integer ageMin)
Must be 13 or higher.void
setRelevantUntilTs(Date relevantUntilTs)
-
Methods inherited from class com.restfb.types.Post.Targeting
addCity, addCountry, addLocale, addRegion, getCities, getCountries, getGeoLocations, getLocales, getRegions, removeCity, removeCountry, removeLocale, removeRegion, setGeoLocations
-
Methods inherited from class com.restfb.types.AbstractFacebookType
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
FeedTargeting
public FeedTargeting()
-
-
Method Detail
-
getCollegeMajors
public List<String> getCollegeMajors()
Target people who majored in these college subjects. Limited to 200 college major values. Use type of adcollegemajor to find Targeting Options and use the returned name to specify.- Returns:
- list of college majors
-
addCollegeMajor
public boolean addCollegeMajor(String collegeMajor)
-
removeCollegeMajor
public boolean removeCollegeMajor(String collegeMajor)
-
getCollegeNetworks
public List<FacebookType> getCollegeNetworks()
Colleges, for college graduates. Limit is 200 values.- Returns:
- list of colleges
-
addCollegeNetwork
public boolean addCollegeNetwork(FacebookType collegeNetwork)
-
removeCollegeNetwork
public boolean removeCollegeNetwork(FacebookType collegeNetwork)
-
getCollegeYears
public List<Integer> getCollegeYears()
Array of integers for graduation year from college.- Returns:
- graduation year list
-
addCollegeYear
public boolean addCollegeYear(Integer collegeYear)
-
removeCollegeYear
public boolean removeCollegeYear(Integer collegeYear)
-
getEducationStatuses
public List<Integer> getEducationStatuses()
Array of integers for targeting based on education level. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).- Returns:
- list of education levels
-
addEducationStatus
public boolean addEducationStatus(Integer educationStatus)
-
removeEducationStatus
public boolean removeEducationStatus(Integer educationStatus)
-
getFanOf
public List<String> getFanOf()
List of object ids. the user should be fan of these objects (interests).- Returns:
- list of object ids
-
removeFanOf
public boolean removeFanOf(String interestId)
-
getGenders
public List<Integer> getGenders()
Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.- Returns:
- list of genders
-
removeGender
public boolean removeGender(Integer gender)
-
getInterestedIn
public List<Integer> getInterestedIn()
Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.- Returns:
- list of 'interested in' types
-
addInterestedIn
public boolean addInterestedIn(Integer interest)
-
removeInterestedIn
public boolean removeInterestedIn(Integer interest)
-
getInterests
public List<String> getInterests()
Indicates targeting based on the 'interests' field of the user profile.- Returns:
- list of 'interests' types
-
addInterests
public boolean addInterests(String interest)
-
removeInterests
public boolean removeInterests(String interest)
-
getRelationshipStatuses
public List<Integer> getRelationshipStatuses()
Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.- Returns:
- list of relationship statuses
-
addRelationshipStatus
public boolean addRelationshipStatus(Integer relationshipStatus)
-
removeRelationshipStatus
public boolean removeRelationshipStatus(Integer relationshipStatus)
-
getWorkNetworks
public List<NamedFacebookType> getWorkNetworks()
Company, organization, or other workplace. Name: Name of targeted workplace. Use type of adworkplace to find Targeting Options and use the returned name to specify this. Id: Unique ID of targeted workplace. Use type of adworkplace to find Targeting Options and use the returned key to specify this (must match paired name value).- Returns:
- list of work networks
-
addWorkNetwork
public boolean addWorkNetwork(NamedFacebookType workNetwork)
-
removeWorkNetwork
public boolean removeWorkNetwork(NamedFacebookType workNetwork)
-
getRelevantUntilTs
public Date getRelevantUntilTs()
-
setRelevantUntilTs
public void setRelevantUntilTs(Date relevantUntilTs)
-
-