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