001// Generated by delombok at Fri Oct 04 16:05:59 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 * <p> 070 * for more information check here: 071 * <a href="https://www.facebook.com/business/recommendations">https://www.facebook.com/business/recommendations</a> 072 */ 073 @Facebook("recommendation_type") 074 private RecommendationType recommendationType; 075 /** 076 * Open Graph story generated by the rating action 077 */ 078 @Facebook("open_graph_story") 079 private PageRating openGraphStory; 080 081 /** 082 * If OpenGraphRating is a new recommendation 083 * 084 * @return <code>true</code> if it is a recommendation, <code>false</code> if it's a rating 085 */ 086 public boolean isRecommendation() { 087 return rating == null; 088 } 089 090 /** 091 * When the reviewer rated this object. 092 * 093 * @return When the reviewer rated this object. 094 */ 095 @Override 096 @java.lang.SuppressWarnings("all") 097 public Date getCreatedTime() { 098 return this.createdTime; 099 } 100 101 /** 102 * When the reviewer rated this object. 103 */ 104 @java.lang.SuppressWarnings("all") 105 public void setCreatedTime(final Date createdTime) { 106 this.createdTime = createdTime; 107 } 108 109 /** 110 * Was a rating included 111 * 112 * @return Was a rating included 113 */ 114 @java.lang.SuppressWarnings("all") 115 public Boolean getHasRating() { 116 return this.hasRating; 117 } 118 119 /** 120 * Was a rating included 121 */ 122 @java.lang.SuppressWarnings("all") 123 public void setHasRating(final Boolean hasRating) { 124 this.hasRating = hasRating; 125 } 126 127 /** 128 * Was there text in the rating 129 * 130 * @return Was there text in the rating 131 */ 132 @java.lang.SuppressWarnings("all") 133 public Boolean getHasReview() { 134 return this.hasReview; 135 } 136 137 /** 138 * Was there text in the rating 139 */ 140 @java.lang.SuppressWarnings("all") 141 public void setHasReview(final Boolean hasReview) { 142 this.hasReview = hasReview; 143 } 144 145 /** 146 * Rating 147 * 148 * @return Rating 149 */ 150 @java.lang.SuppressWarnings("all") 151 public Integer getRating() { 152 return this.rating; 153 } 154 155 /** 156 * Rating 157 */ 158 @java.lang.SuppressWarnings("all") 159 public void setRating(final Integer rating) { 160 this.rating = rating; 161 } 162 163 /** 164 * Review text included in the review 165 * 166 * @return Review text included in the review 167 */ 168 @java.lang.SuppressWarnings("all") 169 public String getReviewText() { 170 return this.reviewText; 171 } 172 173 /** 174 * Review text included in the review 175 */ 176 @java.lang.SuppressWarnings("all") 177 public void setReviewText(final String reviewText) { 178 this.reviewText = reviewText; 179 } 180 181 /** 182 * Person who rated the object 183 * 184 * @return Person who rated the object 185 */ 186 @java.lang.SuppressWarnings("all") 187 public User getReviewer() { 188 return this.reviewer; 189 } 190 191 /** 192 * Person who rated the object 193 */ 194 @java.lang.SuppressWarnings("all") 195 public void setReviewer(final User reviewer) { 196 this.reviewer = reviewer; 197 } 198 199 /** 200 * Recommendation field for change on August 17, 2018 201 * <p> 202 * for more information check here: 203 * <a href="https://www.facebook.com/business/recommendations">https://www.facebook.com/business/recommendations</a> 204 * 205 * @return the recommendation type 206 */ 207 @java.lang.SuppressWarnings("all") 208 public RecommendationType getRecommendationType() { 209 return this.recommendationType; 210 } 211 212 /** 213 * Recommendation field for change on August 17, 2018 214 * <p> 215 * for more information check here: 216 * <a href="https://www.facebook.com/business/recommendations">https://www.facebook.com/business/recommendations</a> 217 */ 218 @java.lang.SuppressWarnings("all") 219 public void setRecommendationType(final RecommendationType recommendationType) { 220 this.recommendationType = recommendationType; 221 } 222 223 /** 224 * Open Graph story generated by the rating action 225 * 226 * @return Open Graph story generated by the rating action 227 */ 228 @java.lang.SuppressWarnings("all") 229 public PageRating getOpenGraphStory() { 230 return this.openGraphStory; 231 } 232 233 /** 234 * Open Graph story generated by the rating action 235 */ 236 @java.lang.SuppressWarnings("all") 237 public void setOpenGraphStory(final PageRating openGraphStory) { 238 this.openGraphStory = openGraphStory; 239 } 240}