001// Generated by delombok at Tue Dec 10 13:42:03 UTC 2024
002/*
003 * Copyright (c) 2010-2024 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;
024
025import com.restfb.Facebook;
026import com.restfb.types.webhook.base.AbstractFeedPostValue;
027
028/**
029 * change value of the feed like
030 */
031public class FeedLikeValue extends AbstractFeedPostValue {
032  @Facebook("user_id")
033  private String userId;
034  @Facebook("parent_id")
035  private String parentId;
036  @Facebook("comment_id")
037  private String commentId;
038
039  /**
040   * returns if the page is liked or a post.
041   * 
042   * if this is a page like you can only fetch the {@code userId} of the liking user. Otherwise you can fetch fields
043   * like {@code parentId}, {@code postId}, {@code senderId} and so on
044   * 
045   * @return if this is a page like
046   */
047  public boolean isPageLike() {
048    return userId != null;
049  }
050
051  /**
052   * returns true if the liked item is a comment
053   * 
054   * @return true if the liked item is a comment
055   */
056  public boolean isCommentLike() {
057    return commentId != null;
058  }
059
060  /**
061   * returns true if the liked item is a post
062   * 
063   * @return true if the liked item is a post
064   */
065  public boolean isPostLike() {
066    return getPostId() != null;
067  }
068
069  @java.lang.SuppressWarnings("all")
070  public String getUserId() {
071    return this.userId;
072  }
073
074  @java.lang.SuppressWarnings("all")
075  public void setUserId(final String userId) {
076    this.userId = userId;
077  }
078
079  @java.lang.SuppressWarnings("all")
080  public String getParentId() {
081    return this.parentId;
082  }
083
084  @java.lang.SuppressWarnings("all")
085  public void setParentId(final String parentId) {
086    this.parentId = parentId;
087  }
088
089  @java.lang.SuppressWarnings("all")
090  public String getCommentId() {
091    return this.commentId;
092  }
093
094  @java.lang.SuppressWarnings("all")
095  public void setCommentId(final String commentId) {
096    this.commentId = commentId;
097  }
098}