001// Generated by delombok at Fri Feb 21 00:22:14 UTC 2025 002/* 003 * Copyright (c) 2010-2025 Mark Allen, Norbert Bartels. 004 * 005 * Permission is hereby granted, free of charge, to any person obtaining a copy 006 * of this software and associated documentation files (the "Software"), to deal 007 * in the Software without restriction, including without limitation the rights 008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 009 * copies of the Software, and to permit persons to whom the Software is 010 * furnished to do so, subject to the following conditions: 011 * 012 * The above copyright notice and this permission notice shall be included in 013 * all copies or substantial portions of the Software. 014 * 015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 021 * THE SOFTWARE. 022 */ 023package com.restfb.types; 024 025import static java.util.Collections.unmodifiableList; 026import java.util.ArrayList; 027import java.util.Date; 028import java.util.List; 029import com.restfb.Connection; 030import com.restfb.Facebook; 031import com.restfb.JsonMapper; 032import com.restfb.JsonMapper.JsonMappingCompleted; 033import com.restfb.annotation.GraphAPI; 034import com.restfb.exception.FacebookJsonMappingException; 035import com.restfb.json.Json; 036import com.restfb.json.JsonObject; 037import com.restfb.json.JsonValue; 038import com.restfb.types.features.HasComments; 039import com.restfb.types.features.HasCreatedTime; 040import com.restfb.types.features.HasMessage; 041 042/** 043 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/post/">Post Graph API type</a>. 044 * 045 * @author <a href="http://restfb.com">Mark Allen</a> 046 * @since 1.5 047 */ 048@SuppressWarnings("deprecation") 049public class Post extends FacebookType implements HasComments, HasCreatedTime, HasMessage { 050 /** 051 * An object containing the ID and name of the user who posted the message. 052 */ 053 @Facebook 054 private From from; 055 /** 056 * Objectives under which this post can be advertised 057 */ 058 @Facebook("allowed_advertising_objects") 059 private String allowedAdvertisingObjects; 060 /** 061 * Objectives under which this post can be advertised 062 */ 063 @Facebook("allowed_advertising_objectives") 064 private List<String> allowedAdvertisingObjectives = new ArrayList<>(); 065 /** 066 * The call to action type used in any Page posts for mobile app engagement ads 067 */ 068 @Facebook("call_to_action") 069 private PostCallToAction callToAction; 070 @Facebook("child_attachments") 071 private List<Post> childAttachments = new ArrayList<>(); 072 /** 073 * If comments are being mirrored to an external site, this function returns the domain of that external site. 074 */ 075 @Facebook("comments_mirroring_domain") 076 private String commentsMirroringDomain; 077 /** 078 * The message. 079 */ 080 @Facebook 081 private String message; 082 /** 083 * ID of the parent post 084 */ 085 @Facebook("parent_id") 086 private String parentId; 087 /** 088 * The permanent static URL to the post on www.facebook.com. 089 * <p> 090 * Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553 091 * </p> 092 * 093 */ 094 @Facebook("permalink_url") 095 private String permalinkUrl; 096 /** 097 * If available, a link to the picture included with this post. 098 */ 099 @Facebook 100 private String picture; 101 /** 102 * The link attached to this post. 103 * 104 * Hint for Graph API 3.3: Use <code>attachment/url_unshimmed</code> instead 105 */ 106 @Facebook 107 @GraphAPI(until = "3.2") 108 private String link; 109 /** 110 * The name of the link. 111 * 112 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 113 */ 114 @Facebook 115 @GraphAPI(until = "3.2") 116 private String name; 117 /** 118 * The caption of the link (appears beneath the link name). 119 * 120 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 121 */ 122 @Facebook 123 @GraphAPI(until = "3.2") 124 private String caption; 125 /** 126 * A description of the link (appears beneath the link caption). 127 * 128 * Hint for Graph API 3.3: Use <code>attachment/description</code> instead 129 */ 130 @Facebook 131 @GraphAPI(until = "3.2") 132 private String description; 133 /** 134 * If this Post has a place, the event associated with the place 135 */ 136 @Facebook 137 @GraphAPI(since = "2.5") 138 private Event event; 139 @Facebook("expanded_height") 140 private Long expandedHeight; 141 @Facebook 142 private Long height; 143 @Facebook("expanded_width") 144 private Long expandedWidth; 145 @Facebook 146 private Long width; 147 @Facebook("video_buying_eligibility") 148 private List<String> videoBuyingEligibility; 149 /** 150 * If available, the source link attached to this post (for example, a flash or video file). 151 * 152 * Hint for Graph API 3.3: Use <code>attachment/media/source</code> instead 153 */ 154 @Facebook 155 @GraphAPI(until = "3.2") 156 private String source; 157 /** 158 * The application used to create this post. 159 */ 160 @Facebook 161 private NamedFacebookType application; 162 /** 163 * A link to an icon representing the type of this post. 164 */ 165 @Facebook 166 private String icon; 167 /** 168 * The privacy settings for this post. 169 */ 170 @Facebook 171 private Privacy privacy; 172 /** 173 * ID of post to use for promotion for stories that cannot be promoted directly 174 */ 175 @Facebook("promotable_id") 176 private String promotableId; 177 /** 178 * Status of the promotion, if the post was promoted. 179 */ 180 @Facebook("promotion_status") 181 private String promotionStatus; 182 /** 183 * Object that controls news feed targeting for this post. 184 * 185 * To force Facebook to fill the <code>feed_targeting</code> field you have to fetch the post with the 186 * <code>fields=feed_targeting</code> parameter, otherwise the feedTargeting is <code>null</code>. 187 * 188 * 189 * @since 1.11.0 190 */ 191 @Facebook("feed_targeting") 192 private FeedTargeting feedTargeting; 193 /** 194 * Whether the viewer can send a private reply to this post (Page viewers only) 195 */ 196 @Facebook("can_reply_privately") 197 @GraphAPI(since = "2.5") 198 private Boolean canReplyPrivately; 199 /** 200 * The profile this was posted on if different from the author. 201 */ 202 @Facebook 203 @GraphAPI(since = "2.5") 204 private NamedFacebookType target; 205 /** 206 * Ads targeting information of the post. 207 */ 208 @Facebook 209 private Targeting targeting; 210 /** 211 * Timeline visibility information of the post. 212 */ 213 @Facebook("timeline_visibility") 214 private String timelineVisibility; 215 /** 216 * Duplicate mapping for "likes" since FB can return it differently in different situations. 217 */ 218 @Facebook("likes") 219 private Long likesCount = 0L; 220 /** 221 * Duplicate mapping for "likes" since FB can return it differently in different situations. 222 * 223 * -- GETTER -- The likes on this post. 224 * <p> 225 * Sometimes this can be {@code null} - check {@link #getLikesCount()} instead in that case. 226 */ 227 @Facebook 228 private Likes likes; 229 /** 230 * The time the post was initially published. 231 */ 232 @Facebook("created_time") 233 private Date createdTime; 234 /** 235 * The time of the last comment on this post. 236 */ 237 @Facebook("updated_time") 238 private Date updatedTime; 239 /** 240 * This field is available on tagged Posts. 241 */ 242 @Facebook("tagged_time") 243 private Date taggedTime; 244 /** 245 * The Facebook object id for an uploaded photo or video. 246 * 247 * Hint for Graph API 3.3: Use <code>attachment/target/id</code> instead 248 * 249 * @since 1.6.5 250 */ 251 @Facebook("object_id") 252 @GraphAPI(until = "3.2") 253 private String objectId; 254 /** 255 * The {@code status_type} of post this is, for example {@code "approved_friend"}. 256 * 257 * @since 1.6.12 258 */ 259 @Facebook("status_type") 260 private String statusType; 261 /** 262 * Text from stories not intentionally generated by users 263 * 264 * @since 1.6.16 265 */ 266 @Facebook 267 private String story; 268 /** 269 * The comments for this post. 270 */ 271 @Facebook 272 private Comments comments; 273 /** 274 * The reactions for this post. 275 */ 276 @Facebook 277 private Reactions reactions; 278 /** 279 * The place where this post occurred. 280 * 281 * @since 1.6.8 282 */ 283 @Facebook 284 private Place place; 285 @Facebook 286 private List<NamedFacebookType> to = new ArrayList<>(); 287 @Facebook 288 private List<Action> actions = new ArrayList<>(); 289 @Facebook 290 private List<Property> properties = new ArrayList<>(); 291 @Facebook("message_tags") 292 private transient String rawMessageTags; 293 private List<MessageTag> messageTags = new ArrayList<>(); 294 @Facebook("story_tags") 295 private transient String rawStoryTags; 296 private List<MessageTag> storyTags = new ArrayList<>(); 297 @Facebook("sponsor_tags") 298 private List<NamedFacebookType> sponsorTags = new ArrayList<>(); 299 @Facebook 300 private Connection<Insight> insights; 301 /** 302 * UNIX timestamp of the scheduled publish time for the post. 303 */ 304 @Facebook("scheduled_publish_time") 305 private Date scheduledPublishTime; 306 /** 307 * Number of times the post has been shared. 308 */ 309 @Facebook 310 private Shares shares; 311 /** 312 * ID of admin who created the post. 313 * 314 * Applies to pages only 315 * 316 * @since 1.10.0 317 */ 318 @Facebook("admin_creator") 319 private NamedFacebookType adminCreator; 320 /** 321 * Whether the post can be promoted on Instagram. 322 * <p> 323 * It returns the enum <code>eligible</code> if it can be promoted. Otherwise it returns an enum for why it cannot be 324 * promoted 325 * </p> 326 * 327 */ 328 @Facebook("instagram_eligibility") 329 private String instagramEligibility; 330 /** 331 * Whether or not the post references an app. 332 */ 333 @Facebook("is_app_share") 334 private Boolean isAppShare; 335 @Facebook("is_eligible_for_promotion") 336 private Boolean isEligibleForPromotion; 337 /** 338 * Whether the post has expiration time that has passed 339 */ 340 @Facebook("is_expired") 341 private Boolean isExpired; 342 /** 343 * If this post is marked as hidden (applies to Pages only). 344 * 345 * @since 1.10.0 346 */ 347 @Facebook("is_hidden") 348 private Boolean isHidden; 349 /** 350 * Returns True if the post was created inline when creating ads. 351 */ 352 @Facebook("is_inline_created") 353 private Boolean isInlineCreated; 354 /** 355 * Whether this post can be promoted in Instagram. 356 */ 357 @Facebook("is_instagram_eligible") 358 private Boolean isInstagramEligible; 359 /** 360 * Whether the post is currently popular. 361 * 362 * Based on whether the total actions as a percentage of reach exceeds a certain threshold 363 */ 364 @Facebook("is_popular") 365 private Boolean isPopular; 366 /** 367 * Indicates whether a scheduled post was published. (applies to scheduled Page Post only, for users post and 368 * instantly published posts this value is always <code>true</code>) 369 * 370 * @since 1.10.0 371 */ 372 @Facebook("is_published") 373 private Boolean isPublished; 374 /** 375 * Whether the post is a spherical video post. 376 */ 377 @Facebook("is_spherical") 378 private Boolean isSpherical; 379 /** 380 * Whether display the end card for a multi-link share post 381 */ 382 @Facebook("multi_share_end_card") 383 private Boolean multiShareEndCard; 384 /** 385 * Whether automatically select the order of the links in multi-link share post when used in an ad 386 */ 387 @Facebook("multi_share_optimized") 388 private Boolean multiShareOptimized; 389 /** 390 * Attachments added to a post. 391 * 392 * To force Facebook to fill the <code>attachments</code> field you have to fetch the post with the 393 * <code>fields=attachments</code> parameter, otherwise the attachments are <code>null</code>. 394 */ 395 @Facebook 396 private Attachments attachments; 397 /** 398 * Full picture URL. 399 * 400 * you get the url to this posts full picture. 401 * 402 * To force Facebook to fill the <code>full_picture</code> field you have to fetch the post with the 403 * <code>fields=full_picture</code> parameter, otherwise the full_picture is <code>null</code>. 404 * 405 */ 406 @Facebook("full_picture") 407 private String fullPicture; 408 /** 409 * ID of the user or Page the post was shared from 410 */ 411 @Facebook 412 private String via; 413 414 /** 415 * A string indicating the object type of this post. 416 * 417 * Hint for Graph API 3.3: <code>attachment/media_type</code> If there is no <code>attachment</code> or <code>media_type=link</code>, the 418 * value is the same as <code>type=status</code>. 419 * 420 * @return A string indicating the object type of this post. 421 */ 422 @Override 423 @GraphAPI(until = "3.2") 424 public String getType() { 425 return super.getType(); 426 } 427 428 private static final long serialVersionUID = 3L; 429 430 /** 431 * Post-JSON-mapping operation that populates the {@code messageTags} field "by hand". 432 * <p> 433 * This is a temporary hack until we have formal public support for it/improved {@code JsonMapper} capabilities so it 434 * can handle arbitrary Map types. 435 * 436 * @param jsonMapper 437 * The {@code JsonMapper} that was used to map to this type. 438 * @since 1.6.11 439 */ 440 @JsonMappingCompleted 441 protected void jsonMappingCompleted(JsonMapper jsonMapper) { 442 if (rawMessageTags != null) { 443 messageTags = createTags(rawMessageTags, jsonMapper); 444 } 445 if (rawStoryTags != null) { 446 storyTags = createTags(rawStoryTags, jsonMapper); 447 } 448 } 449 450 private List<MessageTag> createTags(String rawTags, JsonMapper jsonMapper) { 451 try { 452 return jsonMapper.toJavaList(rawTags, MessageTag.class); 453 } catch (FacebookJsonMappingException je) { 454 } 455 // message tags not in Graph API 2.5 format, ignore this exception and try another way 456 try { 457 List<MessageTag> resultList = new ArrayList<>(); 458 JsonObject rawMessageTagsObject = jsonMapper.toJavaObject(rawTags, JsonObject.class); 459 for (String key : rawMessageTagsObject.names()) { 460 String tagArrayString = rawMessageTagsObject.get(key).toString(); 461 resultList.addAll(jsonMapper.toJavaList(tagArrayString, MessageTag.class)); 462 } 463 return resultList; 464 } catch (FacebookJsonMappingException je) { 465 return new ArrayList<>(); 466 } 467 } 468 469 470 /** 471 * Represents the undocumented {@code Property} type. 472 * 473 * @author <a href="http://restfb.com">Mark Allen</a> 474 * @since 1.6.4 475 */ 476 public static class Property extends AbstractFacebookType { 477 /** 478 * The name of the property. 479 */ 480 @Facebook 481 private String name; 482 /** 483 * The text of the property. 484 */ 485 @Facebook 486 private String text; 487 /** 488 * The URL of the property. 489 */ 490 @Facebook 491 private String href; 492 private static final long serialVersionUID = 1L; 493 494 /** 495 * The name of the property. 496 * 497 * @return The name of the property. 498 */ 499 @java.lang.SuppressWarnings("all") 500 public String getName() { 501 return this.name; 502 } 503 504 /** 505 * The name of the property. 506 */ 507 @java.lang.SuppressWarnings("all") 508 public void setName(final String name) { 509 this.name = name; 510 } 511 512 /** 513 * The text of the property. 514 * 515 * @return The text of the property. 516 */ 517 @java.lang.SuppressWarnings("all") 518 public String getText() { 519 return this.text; 520 } 521 522 /** 523 * The text of the property. 524 */ 525 @java.lang.SuppressWarnings("all") 526 public void setText(final String text) { 527 this.text = text; 528 } 529 530 /** 531 * The URL of the property. 532 * 533 * @return The URL of the property. 534 */ 535 @java.lang.SuppressWarnings("all") 536 public String getHref() { 537 return this.href; 538 } 539 540 /** 541 * The URL of the property. 542 */ 543 @java.lang.SuppressWarnings("all") 544 public void setHref(final String href) { 545 this.href = href; 546 } 547 } 548 549 550 /** 551 * Represents the <a href="http://developers.facebook.com/docs/reference/api/post">Action Graph API type</a>. 552 * 553 * @author <a href="http://restfb.com">Mark Allen</a> 554 * @since 1.5 555 */ 556 public static class Action extends AbstractFacebookType { 557 /** 558 * Gets the name of the action. 559 */ 560 @Facebook 561 private String name; 562 /** 563 * The link for the action. 564 */ 565 @Facebook 566 private String link; 567 private static final long serialVersionUID = 1L; 568 569 /** 570 * Gets the name of the action. 571 * 572 * @return Gets the name of the action. 573 */ 574 @java.lang.SuppressWarnings("all") 575 public String getName() { 576 return this.name; 577 } 578 579 /** 580 * Gets the name of the action. 581 */ 582 @java.lang.SuppressWarnings("all") 583 public void setName(final String name) { 584 this.name = name; 585 } 586 587 /** 588 * The link for the action. 589 * 590 * @return The link for the action. 591 */ 592 @java.lang.SuppressWarnings("all") 593 public String getLink() { 594 return this.link; 595 } 596 597 /** 598 * The link for the action. 599 */ 600 @java.lang.SuppressWarnings("all") 601 public void setLink(final String link) { 602 this.link = link; 603 } 604 } 605 606 607 public static class KeyedType extends NamedFacebookType { 608 private static final long serialVersionUID = 1L; 609 @Facebook 610 private String key; 611 612 @JsonMappingCompleted 613 private void replaceId() { 614 if (getId() == null && key != null) { 615 setId(key); 616 } 617 if (key == null && getId() != null) { 618 setKey(getId()); 619 } 620 } 621 622 @java.lang.SuppressWarnings("all") 623 public String getKey() { 624 return this.key; 625 } 626 627 @java.lang.SuppressWarnings("all") 628 public void setKey(final String key) { 629 this.key = key; 630 } 631 } 632 633 634 public static class Targeting extends AbstractFacebookType { 635 private static final long serialVersionUID = 1L; 636 @Facebook("geo_locations") 637 @GraphAPI(since = "2.8") 638 FeedTargeting geoLocations; 639 @Facebook 640 protected List<KeyedType> cities = new ArrayList<>(); 641 @Facebook 642 protected List<String> countries = new ArrayList<>(); 643 @Facebook 644 protected List<KeyedType> regions = new ArrayList<>(); 645 @Facebook("regions") 646 private transient String rawRegionsString; 647 648 @JsonMappingCompleted 649 private void convertList(JsonMapper mapper) { 650 if (rawRegionsString != null) { 651 JsonValue jsonValue = Json.parse(rawRegionsString); 652 if (jsonValue.isObject()) { 653 JsonObject rawRegions = jsonValue.asObject(); 654 for (String key : rawRegions.names()) { 655 String region = rawRegions.get(key).toString(); 656 regions.add(mapper.toJavaObject(region, KeyedType.class)); 657 } 658 } 659 } 660 } 661 662 @Facebook 663 protected List<Integer> locales = new ArrayList<>(); 664 665 public boolean addCity(KeyedType city) { 666 if (geoLocations != null) { 667 return geoLocations.addCity(city); 668 } 669 return cities.add(city); 670 } 671 672 public boolean addCountry(String country) { 673 if (geoLocations != null) { 674 return geoLocations.addCountry(country); 675 } 676 return countries.add(country); 677 } 678 679 public boolean addLocale(Integer locale) { 680 if (geoLocations != null) { 681 return geoLocations.addLocale(locale); 682 } 683 return locales.add(locale); 684 } 685 686 public boolean addRegion(KeyedType region) { 687 if (geoLocations != null) { 688 return geoLocations.addRegion(region); 689 } 690 return regions.add(region); 691 } 692 693 /** 694 * Values of targeting cities. 695 * 696 * Use type of adcity to find Targeting Options and use the returned key to specify. 697 * 698 * @return list of cities 699 */ 700 public List<KeyedType> getCities() { 701 if (geoLocations != null) { 702 return geoLocations.getCities(); 703 } 704 return unmodifiableList(cities); 705 } 706 707 /** 708 * Values of targeting countries. 709 * 710 * You can specify up to 25 countries. Use ISO 3166 format codes. 711 * 712 * @return list of targeting countries. 713 */ 714 public List<String> getCountries() { 715 if (geoLocations != null) { 716 return geoLocations.getCountries(); 717 } 718 return unmodifiableList(countries); 719 } 720 721 /** 722 * Targeted locales. 723 * 724 * Use type of adlocale to find Targeting Options and use the returned key to specify. 725 * 726 * @return list of locales 727 */ 728 public List<Integer> getLocales() { 729 if (geoLocations != null && !geoLocations.getLocales().isEmpty()) { 730 return geoLocations.getLocales(); 731 } 732 return unmodifiableList(locales); 733 } 734 735 /** 736 * Values of targeting regions. 737 * 738 * Use type of {@code adregion} to find Targeting Options and use the returned key to specify. 739 * 740 * @return list of regions 741 */ 742 public List<KeyedType> getRegions() { 743 if (geoLocations != null) { 744 return geoLocations.getRegions(); 745 } 746 return unmodifiableList(regions); 747 } 748 749 public boolean removeCity(NamedFacebookType city) { 750 if (geoLocations != null) { 751 return geoLocations.removeCity(city); 752 } 753 return cities.remove(city); 754 } 755 756 public boolean removeCountry(String country) { 757 if (geoLocations != null) { 758 return geoLocations.removeCountry(country); 759 } 760 return countries.remove(country); 761 } 762 763 public boolean removeLocale(Integer locale) { 764 if (geoLocations != null) { 765 return geoLocations.removeLocale(locale); 766 } 767 return locales.remove(locale); 768 } 769 770 public boolean removeRegion(NamedFacebookType region) { 771 if (geoLocations != null) { 772 return geoLocations.removeRegion(region); 773 } 774 return regions.remove(region); 775 } 776 777 @GraphAPI(since = "2.8") 778 @java.lang.SuppressWarnings("all") 779 public FeedTargeting getGeoLocations() { 780 return this.geoLocations; 781 } 782 783 @java.lang.SuppressWarnings("all") 784 public void setGeoLocations(final FeedTargeting geoLocations) { 785 this.geoLocations = geoLocations; 786 } 787 } 788 789 790 /** 791 * Object that controls news feed targeting for this post. 792 * 793 * Anyone in these groups will be more likely to see this post, others will be less likely, but may still see it 794 * anyway. Any of the targeting fields shown here can be used, none are required (applies to Pages only). 795 * 796 * Represents the <a href="http://developers.facebook.com/docs/reference/api/post#fields">Feed Targeting API type</a>. 797 */ 798 public static class FeedTargeting extends Targeting { 799 private static final long serialVersionUID = 1L; 800 /** 801 * Maximum age. 802 */ 803 @Facebook("age_max") 804 private Integer ageMax; 805 /** 806 * Must be 13 or higher. Default is 0 807 */ 808 @Facebook("age_min") 809 private Integer ageMin; 810 @Facebook("relevant_until_ts") 811 private Date relevantUntilTs; 812 @Facebook("college_majors") 813 private List<String> collegeMajors = new ArrayList<>(); 814 @Facebook("college_networks") 815 private List<FacebookType> collegeNetworks = new ArrayList<>(); 816 @Facebook("college_years") 817 private List<Integer> collegeYears = new ArrayList<>(); 818 @Facebook("education_statuses") 819 private List<Integer> educationStatuses = new ArrayList<>(); 820 @Facebook("fan_of") 821 private List<String> fanOf = new ArrayList<>(); 822 @Facebook 823 private List<Integer> genders = new ArrayList<>(); 824 @Facebook("interested_in") 825 private List<Integer> interestedIn = new ArrayList<>(); 826 @Facebook 827 private List<String> interests = new ArrayList<>(); 828 @Facebook("relationship_statuses") 829 private List<Integer> relationshipStatuses = new ArrayList<>(); 830 @Facebook("work_networks") 831 private List<NamedFacebookType> workNetworks = new ArrayList<>(); 832 833 /** 834 * Target people who majored in these college subjects. 835 * 836 * Limited to 200 college major values. Use type of adcollegemajor to find Targeting Options and use the returned 837 * name to specify. 838 * 839 * @return list of college majors 840 */ 841 public List<String> getCollegeMajors() { 842 return unmodifiableList(collegeMajors); 843 } 844 845 public boolean addCollegeMajor(String collegeMajor) { 846 return collegeMajors.add(collegeMajor); 847 } 848 849 public boolean removeCollegeMajor(String collegeMajor) { 850 return collegeMajors.remove(collegeMajor); 851 } 852 853 /** 854 * Colleges, for college graduates. 855 * 856 * Limit is 200 values. 857 * 858 * @return list of colleges 859 */ 860 public List<FacebookType> getCollegeNetworks() { 861 return unmodifiableList(collegeNetworks); 862 } 863 864 public boolean addCollegeNetwork(FacebookType collegeNetwork) { 865 return collegeNetworks.add(collegeNetwork); 866 } 867 868 public boolean removeCollegeNetwork(FacebookType collegeNetwork) { 869 return collegeNetworks.remove(collegeNetwork); 870 } 871 872 /** 873 * Array of integers for graduation year from college. 874 * 875 * @return graduation year list 876 */ 877 public List<Integer> getCollegeYears() { 878 return unmodifiableList(collegeYears); 879 } 880 881 public boolean addCollegeYear(Integer collegeYear) { 882 return collegeYears.add(collegeYear); 883 } 884 885 public boolean removeCollegeYear(Integer collegeYear) { 886 return collegeYears.remove(collegeYear); 887 } 888 889 /** 890 * Array of integers for targeting based on education level. 891 * 892 * Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents). 893 * 894 * @return list of education levels 895 */ 896 public List<Integer> getEducationStatuses() { 897 return unmodifiableList(educationStatuses); 898 } 899 900 public boolean addEducationStatus(Integer educationStatus) { 901 return educationStatuses.add(educationStatus); 902 } 903 904 public boolean removeEducationStatus(Integer educationStatus) { 905 return educationStatuses.remove(educationStatus); 906 } 907 908 /** 909 * List of object ids. 910 * 911 * the user should be fan of these objects (interests). 912 * 913 * @return list of object ids 914 */ 915 public List<String> getFanOf() { 916 return unmodifiableList(fanOf); 917 } 918 919 public boolean addFanOf(String interestId) { 920 return fanOf.add(interestId); 921 } 922 923 public boolean removeFanOf(String interestId) { 924 return fanOf.remove(interestId); 925 } 926 927 /** 928 * Target specific genders. 929 * 930 * 1 targets all male viewers and 2 females. Default is to target both. 931 * 932 * @return list of genders 933 */ 934 public List<Integer> getGenders() { 935 return unmodifiableList(genders); 936 } 937 938 public boolean addGender(Integer gender) { 939 return genders.add(gender); 940 } 941 942 public boolean removeGender(Integer gender) { 943 return genders.remove(gender); 944 } 945 946 /** 947 * Indicates targeting based on the 'interested in' field of the user profile. 948 * 949 * You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. 950 * 951 * Please note 'interested in' targeting is not available in France due to local laws. 952 * 953 * @return list of 'interested in' types 954 */ 955 public List<Integer> getInterestedIn() { 956 return unmodifiableList(interestedIn); 957 } 958 959 public boolean addInterestedIn(Integer interest) { 960 return interestedIn.add(interest); 961 } 962 963 public boolean removeInterestedIn(Integer interest) { 964 return interestedIn.remove(interest); 965 } 966 967 /** 968 * Indicates targeting based on the 'interests' field of the user profile. 969 * 970 * @return list of 'interests' types 971 */ 972 public List<String> getInterests() { 973 return unmodifiableList(interests); 974 } 975 976 public boolean addInterests(String interest) { 977 return interests.add(interest); 978 } 979 980 public boolean removeInterests(String interest) { 981 return interests.remove(interest); 982 } 983 984 /** 985 * Array of integers for targeting based on relationship status. 986 * 987 * Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types. 988 * 989 * @return list of relationship statuses 990 */ 991 public List<Integer> getRelationshipStatuses() { 992 return unmodifiableList(relationshipStatuses); 993 } 994 995 public boolean addRelationshipStatus(Integer relationshipStatus) { 996 return relationshipStatuses.add(relationshipStatus); 997 } 998 999 public boolean removeRelationshipStatus(Integer relationshipStatus) { 1000 return relationshipStatuses.remove(relationshipStatus); 1001 } 1002 1003 /** 1004 * Company, organization, or other workplace. 1005 * 1006 * <b>Name</b>: Name of targeted workplace. Use type of adworkplace to find Targeting Options and use the returned 1007 * name to specify this. 1008 * 1009 * <b>Id</b>: Unique ID of targeted workplace. Use type of adworkplace to find Targeting Options and use the 1010 * returned key to specify this (must match paired name value). 1011 * 1012 * @return list of work networks 1013 */ 1014 public List<NamedFacebookType> getWorkNetworks() { 1015 return unmodifiableList(workNetworks); 1016 } 1017 1018 public boolean addWorkNetwork(NamedFacebookType workNetwork) { 1019 return workNetworks.add(workNetwork); 1020 } 1021 1022 public boolean removeWorkNetwork(NamedFacebookType workNetwork) { 1023 return workNetworks.remove(workNetwork); 1024 } 1025 1026 /** 1027 * Maximum age. 1028 */ 1029 @java.lang.SuppressWarnings("all") 1030 public Integer getAgeMax() { 1031 return this.ageMax; 1032 } 1033 1034 /** 1035 * Maximum age. 1036 */ 1037 @java.lang.SuppressWarnings("all") 1038 public void setAgeMax(final Integer ageMax) { 1039 this.ageMax = ageMax; 1040 } 1041 1042 /** 1043 * Must be 13 or higher. Default is 0 1044 */ 1045 @java.lang.SuppressWarnings("all") 1046 public Integer getAgeMin() { 1047 return this.ageMin; 1048 } 1049 1050 /** 1051 * Must be 13 or higher. Default is 0 1052 */ 1053 @java.lang.SuppressWarnings("all") 1054 public void setAgeMin(final Integer ageMin) { 1055 this.ageMin = ageMin; 1056 } 1057 1058 @java.lang.SuppressWarnings("all") 1059 public Date getRelevantUntilTs() { 1060 return this.relevantUntilTs; 1061 } 1062 1063 @java.lang.SuppressWarnings("all") 1064 public void setRelevantUntilTs(final Date relevantUntilTs) { 1065 this.relevantUntilTs = relevantUntilTs; 1066 } 1067 } 1068 1069 1070 /** 1071 * Represents the Shares included the <a href="http://developers.facebook.com/docs/reference/api/post">Post</a> 1072 * response. Presently only supports count. 1073 * 1074 * @since 1.6.11 1075 */ 1076 public static class Shares extends AbstractFacebookType { 1077 /** 1078 * The number of shares. 1079 */ 1080 @Facebook 1081 private Long count = 0L; 1082 private static final long serialVersionUID = 1L; 1083 1084 /** 1085 * The number of shares. 1086 * 1087 * @return The number of shares. 1088 */ 1089 @java.lang.SuppressWarnings("all") 1090 public Long getCount() { 1091 return this.count; 1092 } 1093 1094 /** 1095 * The number of shares. 1096 */ 1097 @java.lang.SuppressWarnings("all") 1098 public void setCount(final Long count) { 1099 this.count = count; 1100 } 1101 } 1102 1103 1104 /** 1105 * Represents the attachments included in<a href="http://developers.facebook.com/docs/reference/api/post">Graph API 1106 * Post type</a>. 1107 * 1108 * @author <a href="https://github.com/kevinleturc/">Kevin Leturc</a> 1109 * @since 1.12.0 1110 */ 1111 public static class Attachments extends AbstractFacebookType { 1112 /** 1113 * All media attachments associated with this post. 1114 * 1115 * @return All media attachments associated with this post. 1116 */ 1117 @Facebook 1118 private List<StoryAttachment> data = new ArrayList<>(); 1119 private static final long serialVersionUID = 1L; 1120 1121 /** 1122 * The attachments. 1123 * 1124 * @return The attachments. 1125 */ 1126 public List<StoryAttachment> getData() { 1127 return unmodifiableList(data); 1128 } 1129 1130 public boolean addData(StoryAttachment attachment) { 1131 return data.add(attachment); 1132 } 1133 1134 public boolean removeData(StoryAttachment attachment) { 1135 return data.remove(attachment); 1136 } 1137 } 1138 1139 /** 1140 * The number of likes on this post. 1141 * 1142 * @return The number of likes on this post. 1143 */ 1144 public Long getLikesCount() { 1145 if (getLikes() != null) { 1146 return getLikes().getTotalCount(); 1147 } 1148 return likesCount; 1149 } 1150 1151 /** 1152 * The number of reactions on this post. 1153 * 1154 * @return The number of reactions on this post. 1155 */ 1156 public Long getReactionsCount() { 1157 if (getReactions() != null) { 1158 return getReactions().getTotalCount(); 1159 } 1160 return 0L; 1161 } 1162 1163 /** 1164 * The number of shares of this post. 1165 * 1166 * @return The number of shares of this post. 1167 */ 1168 public Long getSharesCount() { 1169 if (shares != null) { 1170 return shares.getCount(); 1171 } 1172 return 0L; 1173 } 1174 1175 /** 1176 * The number of comments of this post. 1177 * 1178 * @return The number of comments of this post. 1179 */ 1180 public Long getCommentsCount() { 1181 if (comments != null) { 1182 return comments.getTotalCount(); 1183 } 1184 return 0L; 1185 } 1186 1187 /** 1188 * A list of the profiles mentioned or targeted in this post. 1189 * 1190 * @return A list of the profiles mentioned or targeted in this post. 1191 */ 1192 public List<NamedFacebookType> getTo() { 1193 return unmodifiableList(to); 1194 } 1195 1196 public boolean addTo(NamedFacebookType profile) { 1197 return to.add(profile); 1198 } 1199 1200 public boolean removeTo(NamedFacebookType profile) { 1201 return to.remove(profile); 1202 } 1203 1204 /** 1205 * A list of available action names and links (including commenting, liking, and an optional app-specified action). 1206 * 1207 * @return A list of available action names and links (including commenting, liking, and an optional app-specified 1208 * action). 1209 */ 1210 public List<Action> getActions() { 1211 return unmodifiableList(actions); 1212 } 1213 1214 public boolean addAction(Action action) { 1215 return actions.add(action); 1216 } 1217 1218 public boolean removeAction(Action action) { 1219 return actions.remove(action); 1220 } 1221 1222 /** 1223 * A list of properties for this post. 1224 * <p> 1225 * This field is undocumented. 1226 * 1227 * @return A list of properties for this post. 1228 */ 1229 public List<Property> getProperties() { 1230 return unmodifiableList(properties); 1231 } 1232 1233 public boolean addProperty(Property property) { 1234 return properties.add(property); 1235 } 1236 1237 public boolean removeProperty(Property property) { 1238 return properties.remove(property); 1239 } 1240 1241 /** 1242 * Objects tagged in the message (Users, Pages, etc). 1243 * 1244 * @return Objects tagged in the message (Users, Pages, etc). 1245 * @since 1.6.10 1246 */ 1247 public List<MessageTag> getMessageTags() { 1248 return unmodifiableList(messageTags); 1249 } 1250 1251 public void addMessageTag(MessageTag messageTag) { 1252 messageTags.add(messageTag); 1253 } 1254 1255 public void removeMessageTag(MessageTag messageTag) { 1256 messageTags.remove(messageTag); 1257 } 1258 1259 /** 1260 * Objects tagged in the story (Users, Pages, etc). 1261 * 1262 * @return Objects tagged in the story (Users, Pages, etc). 1263 */ 1264 public List<MessageTag> getStoryTags() { 1265 return unmodifiableList(storyTags); 1266 } 1267 1268 public void addStoryTag(MessageTag messageTag) { 1269 storyTags.add(messageTag); 1270 } 1271 1272 public void removeStoryTag(MessageTag messageTag) { 1273 storyTags.remove(messageTag); 1274 } 1275 1276 /** 1277 * Sub-shares of a multi-link share post 1278 * 1279 * @return Sub-shares of a multi-link share post 1280 */ 1281 public List<Post> getChildAttachments() { 1282 return unmodifiableList(childAttachments); 1283 } 1284 1285 public void addChildAttachment(Post childAttachment) { 1286 childAttachments.add(childAttachment); 1287 } 1288 1289 public void removeChildAttachment(Post childAttachment) { 1290 childAttachments.remove(childAttachment); 1291 } 1292 1293 /** 1294 * A sponsor tag points to a Facebook Page. 1295 * 1296 * (Page owners can allow their business partners to directly boost their posts.) 1297 */ 1298 public List<NamedFacebookType> getSponsorTags() { 1299 return unmodifiableList(sponsorTags); 1300 } 1301 1302 public boolean addSponsorTag(NamedFacebookType sponsorTag) { 1303 return sponsorTags.add(sponsorTag); 1304 } 1305 1306 public boolean removeSponsorTag(NamedFacebookType sponsorTag) { 1307 return sponsorTags.remove(sponsorTag); 1308 } 1309 1310 /** 1311 * An object containing the ID and name of the user who posted the message. 1312 * 1313 * @return An object containing the ID and name of the user who posted the message. 1314 */ 1315 @java.lang.SuppressWarnings("all") 1316 public From getFrom() { 1317 return this.from; 1318 } 1319 1320 /** 1321 * An object containing the ID and name of the user who posted the message. 1322 */ 1323 @java.lang.SuppressWarnings("all") 1324 public void setFrom(final From from) { 1325 this.from = from; 1326 } 1327 1328 /** 1329 * Objectives under which this post can be advertised 1330 * 1331 * @return Objectives under which this post can be advertised 1332 */ 1333 @java.lang.SuppressWarnings("all") 1334 public String getAllowedAdvertisingObjects() { 1335 return this.allowedAdvertisingObjects; 1336 } 1337 1338 /** 1339 * Objectives under which this post can be advertised 1340 */ 1341 @java.lang.SuppressWarnings("all") 1342 public void setAllowedAdvertisingObjects(final String allowedAdvertisingObjects) { 1343 this.allowedAdvertisingObjects = allowedAdvertisingObjects; 1344 } 1345 1346 /** 1347 * Objectives under which this post can be advertised 1348 * 1349 * @return Objectives under which this post can be advertised 1350 */ 1351 @java.lang.SuppressWarnings("all") 1352 public List<String> getAllowedAdvertisingObjectives() { 1353 return this.allowedAdvertisingObjectives; 1354 } 1355 1356 /** 1357 * Objectives under which this post can be advertised 1358 */ 1359 @java.lang.SuppressWarnings("all") 1360 public void setAllowedAdvertisingObjectives(final List<String> allowedAdvertisingObjectives) { 1361 this.allowedAdvertisingObjectives = allowedAdvertisingObjectives; 1362 } 1363 1364 /** 1365 * The call to action type used in any Page posts for mobile app engagement ads 1366 */ 1367 @java.lang.SuppressWarnings("all") 1368 public PostCallToAction getCallToAction() { 1369 return this.callToAction; 1370 } 1371 1372 /** 1373 * The call to action type used in any Page posts for mobile app engagement ads 1374 */ 1375 @java.lang.SuppressWarnings("all") 1376 public void setCallToAction(final PostCallToAction callToAction) { 1377 this.callToAction = callToAction; 1378 } 1379 1380 /** 1381 * If comments are being mirrored to an external site, this function returns the domain of that external site. 1382 * 1383 * @return If comments are being mirrored to an external site, this function returns the domain of that external site. 1384 */ 1385 @java.lang.SuppressWarnings("all") 1386 public String getCommentsMirroringDomain() { 1387 return this.commentsMirroringDomain; 1388 } 1389 1390 /** 1391 * If comments are being mirrored to an external site, this function returns the domain of that external site. 1392 */ 1393 @java.lang.SuppressWarnings("all") 1394 public void setCommentsMirroringDomain(final String commentsMirroringDomain) { 1395 this.commentsMirroringDomain = commentsMirroringDomain; 1396 } 1397 1398 /** 1399 * The message. 1400 * 1401 * @return The message. 1402 */ 1403 @Override 1404 @java.lang.SuppressWarnings("all") 1405 public String getMessage() { 1406 return this.message; 1407 } 1408 1409 /** 1410 * The message. 1411 */ 1412 @java.lang.SuppressWarnings("all") 1413 public void setMessage(final String message) { 1414 this.message = message; 1415 } 1416 1417 /** 1418 * ID of the parent post 1419 * 1420 * @return ID of the parent post 1421 */ 1422 @java.lang.SuppressWarnings("all") 1423 public String getParentId() { 1424 return this.parentId; 1425 } 1426 1427 /** 1428 * ID of the parent post 1429 */ 1430 @java.lang.SuppressWarnings("all") 1431 public void setParentId(final String parentId) { 1432 this.parentId = parentId; 1433 } 1434 1435 /** 1436 * The permanent static URL to the post on www.facebook.com. 1437 * <p> 1438 * Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553 1439 * </p> 1440 * 1441 * @return The permanent static URL to the post on www.facebook.com. 1442 */ 1443 @java.lang.SuppressWarnings("all") 1444 public String getPermalinkUrl() { 1445 return this.permalinkUrl; 1446 } 1447 1448 /** 1449 * The permanent static URL to the post on www.facebook.com. 1450 * <p> 1451 * Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553 1452 * </p> 1453 * 1454 */ 1455 @java.lang.SuppressWarnings("all") 1456 public void setPermalinkUrl(final String permalinkUrl) { 1457 this.permalinkUrl = permalinkUrl; 1458 } 1459 1460 /** 1461 * If available, a link to the picture included with this post. 1462 * 1463 * @return If available, a link to the picture included with this post. 1464 */ 1465 @java.lang.SuppressWarnings("all") 1466 public String getPicture() { 1467 return this.picture; 1468 } 1469 1470 /** 1471 * If available, a link to the picture included with this post. 1472 */ 1473 @java.lang.SuppressWarnings("all") 1474 public void setPicture(final String picture) { 1475 this.picture = picture; 1476 } 1477 1478 /** 1479 * The link attached to this post. 1480 * 1481 * Hint for Graph API 3.3: Use <code>attachment/url_unshimmed</code> instead 1482 * 1483 * @return The link attached to this post. 1484 */ 1485 @GraphAPI(until = "3.2") 1486 @java.lang.SuppressWarnings("all") 1487 public String getLink() { 1488 return this.link; 1489 } 1490 1491 /** 1492 * The link attached to this post. 1493 * 1494 * Hint for Graph API 3.3: Use <code>attachment/url_unshimmed</code> instead 1495 */ 1496 @java.lang.SuppressWarnings("all") 1497 public void setLink(final String link) { 1498 this.link = link; 1499 } 1500 1501 /** 1502 * The name of the link. 1503 * 1504 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 1505 * 1506 * @return The name of the link. 1507 */ 1508 @GraphAPI(until = "3.2") 1509 @java.lang.SuppressWarnings("all") 1510 public String getName() { 1511 return this.name; 1512 } 1513 1514 /** 1515 * The name of the link. 1516 * 1517 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 1518 */ 1519 @java.lang.SuppressWarnings("all") 1520 public void setName(final String name) { 1521 this.name = name; 1522 } 1523 1524 /** 1525 * The caption of the link (appears beneath the link name). 1526 * 1527 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 1528 * 1529 * @return The caption of the link (appears beneath the link name). 1530 */ 1531 @GraphAPI(until = "3.2") 1532 @java.lang.SuppressWarnings("all") 1533 public String getCaption() { 1534 return this.caption; 1535 } 1536 1537 /** 1538 * The caption of the link (appears beneath the link name). 1539 * 1540 * Hint for Graph API 3.3: Use <code>attachment/title</code> instead 1541 */ 1542 @java.lang.SuppressWarnings("all") 1543 public void setCaption(final String caption) { 1544 this.caption = caption; 1545 } 1546 1547 /** 1548 * A description of the link (appears beneath the link caption). 1549 * 1550 * Hint for Graph API 3.3: Use <code>attachment/description</code> instead 1551 * 1552 * @return A description of the link (appears beneath the link caption). 1553 */ 1554 @GraphAPI(until = "3.2") 1555 @java.lang.SuppressWarnings("all") 1556 public String getDescription() { 1557 return this.description; 1558 } 1559 1560 /** 1561 * A description of the link (appears beneath the link caption). 1562 * 1563 * Hint for Graph API 3.3: Use <code>attachment/description</code> instead 1564 */ 1565 @java.lang.SuppressWarnings("all") 1566 public void setDescription(final String description) { 1567 this.description = description; 1568 } 1569 1570 /** 1571 * If this Post has a place, the event associated with the place 1572 */ 1573 @java.lang.SuppressWarnings("all") 1574 public Event getEvent() { 1575 return this.event; 1576 } 1577 1578 /** 1579 * If this Post has a place, the event associated with the place 1580 */ 1581 @java.lang.SuppressWarnings("all") 1582 public void setEvent(final Event event) { 1583 this.event = event; 1584 } 1585 1586 @java.lang.SuppressWarnings("all") 1587 public Long getExpandedHeight() { 1588 return this.expandedHeight; 1589 } 1590 1591 @java.lang.SuppressWarnings("all") 1592 public void setExpandedHeight(final Long expandedHeight) { 1593 this.expandedHeight = expandedHeight; 1594 } 1595 1596 @java.lang.SuppressWarnings("all") 1597 public Long getHeight() { 1598 return this.height; 1599 } 1600 1601 @java.lang.SuppressWarnings("all") 1602 public void setHeight(final Long height) { 1603 this.height = height; 1604 } 1605 1606 @java.lang.SuppressWarnings("all") 1607 public Long getExpandedWidth() { 1608 return this.expandedWidth; 1609 } 1610 1611 @java.lang.SuppressWarnings("all") 1612 public void setExpandedWidth(final Long expandedWidth) { 1613 this.expandedWidth = expandedWidth; 1614 } 1615 1616 @java.lang.SuppressWarnings("all") 1617 public Long getWidth() { 1618 return this.width; 1619 } 1620 1621 @java.lang.SuppressWarnings("all") 1622 public void setWidth(final Long width) { 1623 this.width = width; 1624 } 1625 1626 @java.lang.SuppressWarnings("all") 1627 public List<String> getVideoBuyingEligibility() { 1628 return this.videoBuyingEligibility; 1629 } 1630 1631 @java.lang.SuppressWarnings("all") 1632 public void setVideoBuyingEligibility(final List<String> videoBuyingEligibility) { 1633 this.videoBuyingEligibility = videoBuyingEligibility; 1634 } 1635 1636 /** 1637 * If available, the source link attached to this post (for example, a flash or video file). 1638 * 1639 * Hint for Graph API 3.3: Use <code>attachment/media/source</code> instead 1640 * 1641 * @return If available, the source link attached to this post (for example, a flash or video file). 1642 */ 1643 @GraphAPI(until = "3.2") 1644 @java.lang.SuppressWarnings("all") 1645 public String getSource() { 1646 return this.source; 1647 } 1648 1649 /** 1650 * If available, the source link attached to this post (for example, a flash or video file). 1651 * 1652 * Hint for Graph API 3.3: Use <code>attachment/media/source</code> instead 1653 */ 1654 @java.lang.SuppressWarnings("all") 1655 public void setSource(final String source) { 1656 this.source = source; 1657 } 1658 1659 /** 1660 * The application used to create this post. 1661 * 1662 * @return The application used to create this post. 1663 */ 1664 @java.lang.SuppressWarnings("all") 1665 public NamedFacebookType getApplication() { 1666 return this.application; 1667 } 1668 1669 /** 1670 * The application used to create this post. 1671 */ 1672 @java.lang.SuppressWarnings("all") 1673 public void setApplication(final NamedFacebookType application) { 1674 this.application = application; 1675 } 1676 1677 /** 1678 * A link to an icon representing the type of this post. 1679 * 1680 * @return A link to an icon representing the type of this post. 1681 */ 1682 @java.lang.SuppressWarnings("all") 1683 public String getIcon() { 1684 return this.icon; 1685 } 1686 1687 /** 1688 * A link to an icon representing the type of this post. 1689 */ 1690 @java.lang.SuppressWarnings("all") 1691 public void setIcon(final String icon) { 1692 this.icon = icon; 1693 } 1694 1695 /** 1696 * The privacy settings for this post. 1697 * 1698 * @return The privacy settings for this post. 1699 */ 1700 @java.lang.SuppressWarnings("all") 1701 public Privacy getPrivacy() { 1702 return this.privacy; 1703 } 1704 1705 /** 1706 * The privacy settings for this post. 1707 */ 1708 @java.lang.SuppressWarnings("all") 1709 public void setPrivacy(final Privacy privacy) { 1710 this.privacy = privacy; 1711 } 1712 1713 /** 1714 * ID of post to use for promotion for stories that cannot be promoted directly 1715 */ 1716 @java.lang.SuppressWarnings("all") 1717 public String getPromotableId() { 1718 return this.promotableId; 1719 } 1720 1721 /** 1722 * ID of post to use for promotion for stories that cannot be promoted directly 1723 */ 1724 @java.lang.SuppressWarnings("all") 1725 public void setPromotableId(final String promotableId) { 1726 this.promotableId = promotableId; 1727 } 1728 1729 /** 1730 * Status of the promotion, if the post was promoted. 1731 * 1732 * @return Status of the promotion, if the post was promoted 1733 */ 1734 @java.lang.SuppressWarnings("all") 1735 public String getPromotionStatus() { 1736 return this.promotionStatus; 1737 } 1738 1739 /** 1740 * Status of the promotion, if the post was promoted. 1741 */ 1742 @java.lang.SuppressWarnings("all") 1743 public void setPromotionStatus(final String promotionStatus) { 1744 this.promotionStatus = promotionStatus; 1745 } 1746 1747 /** 1748 * Object that controls news feed targeting for this post. 1749 * 1750 * To force Facebook to fill the <code>feed_targeting</code> field you have to fetch the post with the 1751 * <code>fields=feed_targeting</code> parameter, otherwise the feedTargeting is <code>null</code>. 1752 * 1753 * 1754 * @since 1.11.0 1755 */ 1756 @java.lang.SuppressWarnings("all") 1757 public FeedTargeting getFeedTargeting() { 1758 return this.feedTargeting; 1759 } 1760 1761 /** 1762 * Object that controls news feed targeting for this post. 1763 * 1764 * To force Facebook to fill the <code>feed_targeting</code> field you have to fetch the post with the 1765 * <code>fields=feed_targeting</code> parameter, otherwise the feedTargeting is <code>null</code>. 1766 * 1767 * 1768 * @since 1.11.0 1769 */ 1770 @java.lang.SuppressWarnings("all") 1771 public void setFeedTargeting(final FeedTargeting feedTargeting) { 1772 this.feedTargeting = feedTargeting; 1773 } 1774 1775 /** 1776 * Whether the viewer can send a private reply to this post (Page viewers only) 1777 * 1778 * @return Whether the viewer can send a private reply to this post 1779 */ 1780 @GraphAPI(since = "2.5") 1781 @java.lang.SuppressWarnings("all") 1782 public Boolean getCanReplyPrivately() { 1783 return this.canReplyPrivately; 1784 } 1785 1786 /** 1787 * Whether the viewer can send a private reply to this post (Page viewers only) 1788 */ 1789 @java.lang.SuppressWarnings("all") 1790 public void setCanReplyPrivately(final Boolean canReplyPrivately) { 1791 this.canReplyPrivately = canReplyPrivately; 1792 } 1793 1794 /** 1795 * The profile this was posted on if different from the author. 1796 * 1797 * @return The profile this was posted on if different from the author 1798 */ 1799 @GraphAPI(since = "2.5") 1800 @java.lang.SuppressWarnings("all") 1801 public NamedFacebookType getTarget() { 1802 return this.target; 1803 } 1804 1805 /** 1806 * The profile this was posted on if different from the author. 1807 */ 1808 @java.lang.SuppressWarnings("all") 1809 public void setTarget(final NamedFacebookType target) { 1810 this.target = target; 1811 } 1812 1813 /** 1814 * Ads targeting information of the post. 1815 * 1816 * @return Ads targeting information of the post 1817 */ 1818 @java.lang.SuppressWarnings("all") 1819 public Targeting getTargeting() { 1820 return this.targeting; 1821 } 1822 1823 /** 1824 * Ads targeting information of the post. 1825 */ 1826 @java.lang.SuppressWarnings("all") 1827 public void setTargeting(final Targeting targeting) { 1828 this.targeting = targeting; 1829 } 1830 1831 /** 1832 * Timeline visibility information of the post. 1833 * 1834 * @return timeline visibility information of the post 1835 */ 1836 @java.lang.SuppressWarnings("all") 1837 public String getTimelineVisibility() { 1838 return this.timelineVisibility; 1839 } 1840 1841 /** 1842 * Timeline visibility information of the post. 1843 */ 1844 @java.lang.SuppressWarnings("all") 1845 public void setTimelineVisibility(final String timelineVisibility) { 1846 this.timelineVisibility = timelineVisibility; 1847 } 1848 1849 /** 1850 * Duplicate mapping for "likes" since FB can return it differently in different situations. 1851 * 1852 * -- GETTER -- The likes on this post. 1853 * <p> 1854 * Sometimes this can be {@code null} - check {@link #getLikesCount()} instead in that case. 1855 * 1856 * @return The likes on this post. 1857 */ 1858 @java.lang.SuppressWarnings("all") 1859 public Likes getLikes() { 1860 return this.likes; 1861 } 1862 1863 /** 1864 * Duplicate mapping for "likes" since FB can return it differently in different situations. 1865 * 1866 * -- GETTER -- The likes on this post. 1867 * <p> 1868 * Sometimes this can be {@code null} - check {@link #getLikesCount()} instead in that case. 1869 */ 1870 @java.lang.SuppressWarnings("all") 1871 public void setLikes(final Likes likes) { 1872 this.likes = likes; 1873 } 1874 1875 /** 1876 * The time the post was initially published. 1877 * 1878 * @return The time the post was initially published. 1879 */ 1880 @Override 1881 @java.lang.SuppressWarnings("all") 1882 public Date getCreatedTime() { 1883 return this.createdTime; 1884 } 1885 1886 /** 1887 * The time the post was initially published. 1888 */ 1889 @java.lang.SuppressWarnings("all") 1890 public void setCreatedTime(final Date createdTime) { 1891 this.createdTime = createdTime; 1892 } 1893 1894 /** 1895 * The time of the last comment on this post. 1896 * 1897 * @return The time of the last comment on this post. 1898 */ 1899 @java.lang.SuppressWarnings("all") 1900 public Date getUpdatedTime() { 1901 return this.updatedTime; 1902 } 1903 1904 /** 1905 * The time of the last comment on this post. 1906 */ 1907 @java.lang.SuppressWarnings("all") 1908 public void setUpdatedTime(final Date updatedTime) { 1909 this.updatedTime = updatedTime; 1910 } 1911 1912 /** 1913 * This field is available on tagged Posts. 1914 * 1915 * @return The tagging Date of the Post 1916 */ 1917 @java.lang.SuppressWarnings("all") 1918 public Date getTaggedTime() { 1919 return this.taggedTime; 1920 } 1921 1922 /** 1923 * This field is available on tagged Posts. 1924 */ 1925 @java.lang.SuppressWarnings("all") 1926 public void setTaggedTime(final Date taggedTime) { 1927 this.taggedTime = taggedTime; 1928 } 1929 1930 /** 1931 * The Facebook object id for an uploaded photo or video. 1932 * 1933 * Hint for Graph API 3.3: Use <code>attachment/target/id</code> instead 1934 * 1935 * @return The Facebook object id for an uploaded photo or video. 1936 * @since 1.6.5 1937 */ 1938 @GraphAPI(until = "3.2") 1939 @java.lang.SuppressWarnings("all") 1940 public String getObjectId() { 1941 return this.objectId; 1942 } 1943 1944 /** 1945 * The Facebook object id for an uploaded photo or video. 1946 * 1947 * Hint for Graph API 3.3: Use <code>attachment/target/id</code> instead 1948 * 1949 * @since 1.6.5 1950 */ 1951 @java.lang.SuppressWarnings("all") 1952 public void setObjectId(final String objectId) { 1953 this.objectId = objectId; 1954 } 1955 1956 /** 1957 * The {@code status_type} of post this is, for example {@code "approved_friend"}. 1958 * 1959 * @return The {@code status_type} of post this is, for example {@code "approved_friend"}. 1960 * @since 1.6.12 1961 */ 1962 @java.lang.SuppressWarnings("all") 1963 public String getStatusType() { 1964 return this.statusType; 1965 } 1966 1967 /** 1968 * The {@code status_type} of post this is, for example {@code "approved_friend"}. 1969 * 1970 * @since 1.6.12 1971 */ 1972 @java.lang.SuppressWarnings("all") 1973 public void setStatusType(final String statusType) { 1974 this.statusType = statusType; 1975 } 1976 1977 /** 1978 * Text from stories not intentionally generated by users 1979 * 1980 * @return Text from stories not intentionally generated by users 1981 * @since 1.6.16 1982 */ 1983 @java.lang.SuppressWarnings("all") 1984 public String getStory() { 1985 return this.story; 1986 } 1987 1988 /** 1989 * Text from stories not intentionally generated by users 1990 * 1991 * @since 1.6.16 1992 */ 1993 @java.lang.SuppressWarnings("all") 1994 public void setStory(final String story) { 1995 this.story = story; 1996 } 1997 1998 /** 1999 * The comments for this post. 2000 * 2001 * @return The comments for this post. 2002 */ 2003 @Override 2004 @java.lang.SuppressWarnings("all") 2005 public Comments getComments() { 2006 return this.comments; 2007 } 2008 2009 /** 2010 * The comments for this post. 2011 */ 2012 @java.lang.SuppressWarnings("all") 2013 public void setComments(final Comments comments) { 2014 this.comments = comments; 2015 } 2016 2017 /** 2018 * The reactions for this post. 2019 * 2020 * @return The reactions for this post. 2021 */ 2022 @java.lang.SuppressWarnings("all") 2023 public Reactions getReactions() { 2024 return this.reactions; 2025 } 2026 2027 /** 2028 * The reactions for this post. 2029 */ 2030 @java.lang.SuppressWarnings("all") 2031 public void setReactions(final Reactions reactions) { 2032 this.reactions = reactions; 2033 } 2034 2035 /** 2036 * The place where this post occurred. 2037 * 2038 * @return The place where this post occurred. 2039 * @since 1.6.8 2040 */ 2041 @java.lang.SuppressWarnings("all") 2042 public Place getPlace() { 2043 return this.place; 2044 } 2045 2046 /** 2047 * The place where this post occurred. 2048 * 2049 * @since 1.6.8 2050 */ 2051 @java.lang.SuppressWarnings("all") 2052 public void setPlace(final Place place) { 2053 this.place = place; 2054 } 2055 2056 @java.lang.SuppressWarnings("all") 2057 public Connection<Insight> getInsights() { 2058 return this.insights; 2059 } 2060 2061 @java.lang.SuppressWarnings("all") 2062 public void setInsights(final Connection<Insight> insights) { 2063 this.insights = insights; 2064 } 2065 2066 /** 2067 * UNIX timestamp of the scheduled publish time for the post. 2068 * 2069 * @return UNIX timestamp of the scheduled publish time for the post 2070 */ 2071 @java.lang.SuppressWarnings("all") 2072 public Date getScheduledPublishTime() { 2073 return this.scheduledPublishTime; 2074 } 2075 2076 /** 2077 * UNIX timestamp of the scheduled publish time for the post. 2078 */ 2079 @java.lang.SuppressWarnings("all") 2080 public void setScheduledPublishTime(final Date scheduledPublishTime) { 2081 this.scheduledPublishTime = scheduledPublishTime; 2082 } 2083 2084 /** 2085 * Number of times the post has been shared. 2086 * 2087 * @return Number of times the post has been shared 2088 */ 2089 @java.lang.SuppressWarnings("all") 2090 public Shares getShares() { 2091 return this.shares; 2092 } 2093 2094 /** 2095 * Number of times the post has been shared. 2096 */ 2097 @java.lang.SuppressWarnings("all") 2098 public void setShares(final Shares shares) { 2099 this.shares = shares; 2100 } 2101 2102 /** 2103 * ID of admin who created the post. 2104 * 2105 * Applies to pages only 2106 * 2107 * @return ID of admin who created the post. 2108 * @since 1.10.0 2109 */ 2110 @java.lang.SuppressWarnings("all") 2111 public NamedFacebookType getAdminCreator() { 2112 return this.adminCreator; 2113 } 2114 2115 /** 2116 * ID of admin who created the post. 2117 * 2118 * Applies to pages only 2119 * 2120 * @since 1.10.0 2121 */ 2122 @java.lang.SuppressWarnings("all") 2123 public void setAdminCreator(final NamedFacebookType adminCreator) { 2124 this.adminCreator = adminCreator; 2125 } 2126 2127 /** 2128 * Whether the post can be promoted on Instagram. 2129 * <p> 2130 * It returns the enum <code>eligible</code> if it can be promoted. Otherwise it returns an enum for why it cannot be 2131 * promoted 2132 * </p> 2133 * 2134 * @return Whether the post can be promoted on Instagram 2135 */ 2136 @java.lang.SuppressWarnings("all") 2137 public String getInstagramEligibility() { 2138 return this.instagramEligibility; 2139 } 2140 2141 /** 2142 * Whether the post can be promoted on Instagram. 2143 * <p> 2144 * It returns the enum <code>eligible</code> if it can be promoted. Otherwise it returns an enum for why it cannot be 2145 * promoted 2146 * </p> 2147 * 2148 */ 2149 @java.lang.SuppressWarnings("all") 2150 public void setInstagramEligibility(final String instagramEligibility) { 2151 this.instagramEligibility = instagramEligibility; 2152 } 2153 2154 /** 2155 * Whether or not the post references an app. 2156 * 2157 * @return Whether or not the post references an app 2158 */ 2159 @java.lang.SuppressWarnings("all") 2160 public Boolean getIsAppShare() { 2161 return this.isAppShare; 2162 } 2163 2164 /** 2165 * Whether or not the post references an app. 2166 */ 2167 @java.lang.SuppressWarnings("all") 2168 public void setIsAppShare(final Boolean isAppShare) { 2169 this.isAppShare = isAppShare; 2170 } 2171 2172 @java.lang.SuppressWarnings("all") 2173 public Boolean getIsEligibleForPromotion() { 2174 return this.isEligibleForPromotion; 2175 } 2176 2177 @java.lang.SuppressWarnings("all") 2178 public void setIsEligibleForPromotion(final Boolean isEligibleForPromotion) { 2179 this.isEligibleForPromotion = isEligibleForPromotion; 2180 } 2181 2182 /** 2183 * Whether the post has expiration time that has passed 2184 * 2185 * @return Whether the post has expiration time that has passed 2186 */ 2187 @java.lang.SuppressWarnings("all") 2188 public Boolean getIsExpired() { 2189 return this.isExpired; 2190 } 2191 2192 /** 2193 * Whether the post has expiration time that has passed 2194 */ 2195 @java.lang.SuppressWarnings("all") 2196 public void setIsExpired(final Boolean isExpired) { 2197 this.isExpired = isExpired; 2198 } 2199 2200 /** 2201 * If this post is marked as hidden (applies to Pages only). 2202 * 2203 * @since 1.10.0 2204 * @return if this post is marked as hidden 2205 */ 2206 @java.lang.SuppressWarnings("all") 2207 public Boolean getIsHidden() { 2208 return this.isHidden; 2209 } 2210 2211 /** 2212 * If this post is marked as hidden (applies to Pages only). 2213 * 2214 * @since 1.10.0 2215 */ 2216 @java.lang.SuppressWarnings("all") 2217 public void setIsHidden(final Boolean isHidden) { 2218 this.isHidden = isHidden; 2219 } 2220 2221 /** 2222 * Returns True if the post was created inline when creating ads. 2223 */ 2224 @java.lang.SuppressWarnings("all") 2225 public Boolean getIsInlineCreated() { 2226 return this.isInlineCreated; 2227 } 2228 2229 /** 2230 * Returns True if the post was created inline when creating ads. 2231 */ 2232 @java.lang.SuppressWarnings("all") 2233 public void setIsInlineCreated(final Boolean isInlineCreated) { 2234 this.isInlineCreated = isInlineCreated; 2235 } 2236 2237 /** 2238 * Whether this post can be promoted in Instagram. 2239 * 2240 * @return Whether this post can be promoted in Instagram 2241 */ 2242 @java.lang.SuppressWarnings("all") 2243 public Boolean getIsInstagramEligible() { 2244 return this.isInstagramEligible; 2245 } 2246 2247 /** 2248 * Whether this post can be promoted in Instagram. 2249 */ 2250 @java.lang.SuppressWarnings("all") 2251 public void setIsInstagramEligible(final Boolean isInstagramEligible) { 2252 this.isInstagramEligible = isInstagramEligible; 2253 } 2254 2255 /** 2256 * Whether the post is currently popular. 2257 * 2258 * Based on whether the total actions as a percentage of reach exceeds a certain threshold 2259 * 2260 * @return Whether the post is currently popular 2261 */ 2262 @java.lang.SuppressWarnings("all") 2263 public Boolean getIsPopular() { 2264 return this.isPopular; 2265 } 2266 2267 /** 2268 * Whether the post is currently popular. 2269 * 2270 * Based on whether the total actions as a percentage of reach exceeds a certain threshold 2271 */ 2272 @java.lang.SuppressWarnings("all") 2273 public void setIsPopular(final Boolean isPopular) { 2274 this.isPopular = isPopular; 2275 } 2276 2277 /** 2278 * Indicates whether a scheduled post was published. (applies to scheduled Page Post only, for users post and 2279 * instantly published posts this value is always <code>true</code>) 2280 * 2281 * @since 1.10.0 2282 * @return indicates whether a scheduled post was published 2283 */ 2284 @java.lang.SuppressWarnings("all") 2285 public Boolean getIsPublished() { 2286 return this.isPublished; 2287 } 2288 2289 /** 2290 * Indicates whether a scheduled post was published. (applies to scheduled Page Post only, for users post and 2291 * instantly published posts this value is always <code>true</code>) 2292 * 2293 * @since 1.10.0 2294 */ 2295 @java.lang.SuppressWarnings("all") 2296 public void setIsPublished(final Boolean isPublished) { 2297 this.isPublished = isPublished; 2298 } 2299 2300 /** 2301 * Whether the post is a spherical video post. 2302 * 2303 * @return Whether the post is a spherical video post 2304 */ 2305 @java.lang.SuppressWarnings("all") 2306 public Boolean getIsSpherical() { 2307 return this.isSpherical; 2308 } 2309 2310 /** 2311 * Whether the post is a spherical video post. 2312 */ 2313 @java.lang.SuppressWarnings("all") 2314 public void setIsSpherical(final Boolean isSpherical) { 2315 this.isSpherical = isSpherical; 2316 } 2317 2318 /** 2319 * Whether display the end card for a multi-link share post 2320 */ 2321 @java.lang.SuppressWarnings("all") 2322 public Boolean getMultiShareEndCard() { 2323 return this.multiShareEndCard; 2324 } 2325 2326 /** 2327 * Whether display the end card for a multi-link share post 2328 */ 2329 @java.lang.SuppressWarnings("all") 2330 public void setMultiShareEndCard(final Boolean multiShareEndCard) { 2331 this.multiShareEndCard = multiShareEndCard; 2332 } 2333 2334 /** 2335 * Whether automatically select the order of the links in multi-link share post when used in an ad 2336 */ 2337 @java.lang.SuppressWarnings("all") 2338 public Boolean getMultiShareOptimized() { 2339 return this.multiShareOptimized; 2340 } 2341 2342 /** 2343 * Whether automatically select the order of the links in multi-link share post when used in an ad 2344 */ 2345 @java.lang.SuppressWarnings("all") 2346 public void setMultiShareOptimized(final Boolean multiShareOptimized) { 2347 this.multiShareOptimized = multiShareOptimized; 2348 } 2349 2350 /** 2351 * Attachments added to a post. 2352 * 2353 * To force Facebook to fill the <code>attachments</code> field you have to fetch the post with the 2354 * <code>fields=attachments</code> parameter, otherwise the attachments are <code>null</code>. 2355 * 2356 * @return Attachment on the post 2357 */ 2358 @java.lang.SuppressWarnings("all") 2359 public Attachments getAttachments() { 2360 return this.attachments; 2361 } 2362 2363 /** 2364 * Attachments added to a post. 2365 * 2366 * To force Facebook to fill the <code>attachments</code> field you have to fetch the post with the 2367 * <code>fields=attachments</code> parameter, otherwise the attachments are <code>null</code>. 2368 */ 2369 @java.lang.SuppressWarnings("all") 2370 public void setAttachments(final Attachments attachments) { 2371 this.attachments = attachments; 2372 } 2373 2374 /** 2375 * Full picture URL. 2376 * 2377 * you get the url to this posts full picture. 2378 * 2379 * To force Facebook to fill the <code>full_picture</code> field you have to fetch the post with the 2380 * <code>fields=full_picture</code> parameter, otherwise the full_picture is <code>null</code>. 2381 * 2382 * @return String representing the url to the post's full picture 2383 */ 2384 @java.lang.SuppressWarnings("all") 2385 public String getFullPicture() { 2386 return this.fullPicture; 2387 } 2388 2389 /** 2390 * Full picture URL. 2391 * 2392 * you get the url to this posts full picture. 2393 * 2394 * To force Facebook to fill the <code>full_picture</code> field you have to fetch the post with the 2395 * <code>fields=full_picture</code> parameter, otherwise the full_picture is <code>null</code>. 2396 * 2397 */ 2398 @java.lang.SuppressWarnings("all") 2399 public void setFullPicture(final String fullPicture) { 2400 this.fullPicture = fullPicture; 2401 } 2402 2403 /** 2404 * ID of the user or Page the post was shared from 2405 */ 2406 @java.lang.SuppressWarnings("all") 2407 public String getVia() { 2408 return this.via; 2409 } 2410 2411 /** 2412 * ID of the user or Page the post was shared from 2413 */ 2414 @java.lang.SuppressWarnings("all") 2415 public void setVia(final String via) { 2416 this.via = via; 2417 } 2418}