001// Generated by delombok at Sun Apr 14 14:59:49 CEST 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;
024
025import java.util.Date;
026import com.restfb.Facebook;
027import com.restfb.types.features.HasCreatedTime;
028
029/**
030 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/v2.5/open-graph-rating/"> Open Graph
031 * Rating API type</a>.
032 *
033 * @author Alexander Nenkov
034 * @since 1.20.0
035 */
036public class OpenGraphRating extends FacebookType implements HasCreatedTime {
037  /**
038   * When the reviewer rated this object.
039   */
040  @Facebook("created_time")
041  private Date createdTime;
042  /**
043   * Was a rating included
044   */
045  @Facebook("has_rating")
046  private Boolean hasRating;
047  /**
048   * Was there text in the rating
049   */
050  @Facebook("has_review")
051  private Boolean hasReview;
052  /**
053   * Rating
054   */
055  @Facebook("rating")
056  private Integer rating;
057  /**
058   * Review text included in the review
059   */
060  @Facebook("review_text")
061  private String reviewText;
062  /**
063   * Person who rated the object
064   */
065  @Facebook("reviewer")
066  private User reviewer;
067  /**
068   * Recommendation field for change on August 17, 2018
069   *
070   * for more information check here: https://www.facebook.com/business/recommendations
071   */
072  @Facebook("recommendation_type")
073  private RecommendationType recommendationType;
074  /**
075   * Open Graph story generated by the rating action
076   */
077  @Facebook("open_graph_story")
078  private PageRating openGraphStory;
079
080  /**
081   * If OpenGraphRating is a new recommendation
082   * 
083   * @return <code>true</code> if it is a recommendation, <code>false</code> if it's a rating
084   */
085  public boolean isRecommendation() {
086    return rating == null;
087  }
088
089  /**
090   * When the reviewer rated this object.
091   *
092   * @return When the reviewer rated this object.
093   */
094  @Override
095  @java.lang.SuppressWarnings("all")
096  public Date getCreatedTime() {
097    return this.createdTime;
098  }
099
100  /**
101   * When the reviewer rated this object.
102   */
103  @java.lang.SuppressWarnings("all")
104  public void setCreatedTime(final Date createdTime) {
105    this.createdTime = createdTime;
106  }
107
108  /**
109   * Was a rating included
110   *
111   * @return Was a rating included
112   */
113  @java.lang.SuppressWarnings("all")
114  public Boolean getHasRating() {
115    return this.hasRating;
116  }
117
118  /**
119   * Was a rating included
120   */
121  @java.lang.SuppressWarnings("all")
122  public void setHasRating(final Boolean hasRating) {
123    this.hasRating = hasRating;
124  }
125
126  /**
127   * Was there text in the rating
128   *
129   * @return Was there text in the rating
130   */
131  @java.lang.SuppressWarnings("all")
132  public Boolean getHasReview() {
133    return this.hasReview;
134  }
135
136  /**
137   * Was there text in the rating
138   */
139  @java.lang.SuppressWarnings("all")
140  public void setHasReview(final Boolean hasReview) {
141    this.hasReview = hasReview;
142  }
143
144  /**
145   * Rating
146   *
147   * @return Rating
148   */
149  @java.lang.SuppressWarnings("all")
150  public Integer getRating() {
151    return this.rating;
152  }
153
154  /**
155   * Rating
156   */
157  @java.lang.SuppressWarnings("all")
158  public void setRating(final Integer rating) {
159    this.rating = rating;
160  }
161
162  /**
163   * Review text included in the review
164   *
165   * @return Review text included in the review
166   */
167  @java.lang.SuppressWarnings("all")
168  public String getReviewText() {
169    return this.reviewText;
170  }
171
172  /**
173   * Review text included in the review
174   */
175  @java.lang.SuppressWarnings("all")
176  public void setReviewText(final String reviewText) {
177    this.reviewText = reviewText;
178  }
179
180  /**
181   * Person who rated the object
182   *
183   * @return Person who rated the object
184   */
185  @java.lang.SuppressWarnings("all")
186  public User getReviewer() {
187    return this.reviewer;
188  }
189
190  /**
191   * Person who rated the object
192   */
193  @java.lang.SuppressWarnings("all")
194  public void setReviewer(final User reviewer) {
195    this.reviewer = reviewer;
196  }
197
198  /**
199   * Recommendation field for change on August 17, 2018
200   *
201   * for more information check here: https://www.facebook.com/business/recommendations
202   *
203   * @return the recommendation type
204   */
205  @java.lang.SuppressWarnings("all")
206  public RecommendationType getRecommendationType() {
207    return this.recommendationType;
208  }
209
210  /**
211   * Recommendation field for change on August 17, 2018
212   *
213   * for more information check here: https://www.facebook.com/business/recommendations
214   */
215  @java.lang.SuppressWarnings("all")
216  public void setRecommendationType(final RecommendationType recommendationType) {
217    this.recommendationType = recommendationType;
218  }
219
220  /**
221   * Open Graph story generated by the rating action
222   *
223   * @return Open Graph story generated by the rating action
224   */
225  @java.lang.SuppressWarnings("all")
226  public PageRating getOpenGraphStory() {
227    return this.openGraphStory;
228  }
229
230  /**
231   * Open Graph story generated by the rating action
232   */
233  @java.lang.SuppressWarnings("all")
234  public void setOpenGraphStory(final PageRating openGraphStory) {
235    this.openGraphStory = openGraphStory;
236  }
237}