001// Generated by delombok at Fri Nov 22 22:30:55 CET 2019
002/**
003 * Copyright (c) 2010-2019 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.webhook.base;
024
025import com.restfb.Facebook;
026
027public abstract class AbstractFeedPostValue extends BaseChangeValue {
028  @Facebook("post_id")
029  private String postId;
030  @Facebook("sender_id")
031  private String senderId;
032  @Facebook("sender_name")
033  private String senderName;
034  @Facebook
035  private From from;
036
037  /**
038   * returns the {@code sender_id}.
039   *
040   * Use {@link AbstractFeedPostValue#getFrom()} instead, because with Graph API 2.11 sender_id is deprecated
041   * 
042   * @return the sender id
043   */
044  public String getSenderId() {
045    if (from != null) {
046      return from.getId();
047    }
048    return senderId;
049  }
050
051  /**
052   * returns the {@code sender_name}.
053   *
054   * Use {@link AbstractFeedPostValue#getFrom()} instead, because with Graph API 2.11 sender_name is deprecated
055   *
056   * @return the sender name
057   */
058  public String getSenderName() {
059    if (from != null) {
060      return from.getName();
061    }
062    return senderName;
063  }
064
065  /**
066   * returns the sender (from) of the feed value
067   * 
068   * @return from of the feed value
069   */
070  public From getFrom() {
071    if (from != null) {
072      return from;
073    } else {
074      return new From(senderId, senderName);
075    }
076  }
077
078  @java.lang.SuppressWarnings("all")
079  public String getPostId() {
080    return this.postId;
081  }
082
083  @java.lang.SuppressWarnings("all")
084  public void setPostId(final String postId) {
085    this.postId = postId;
086  }
087
088  @java.lang.SuppressWarnings("all")
089  public void setSenderId(final String senderId) {
090    this.senderId = senderId;
091  }
092
093  @java.lang.SuppressWarnings("all")
094  public void setSenderName(final String senderName) {
095    this.senderName = senderName;
096  }
097}