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