001
014
015 package com.liferay.portlet.ratings.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.util.HashMap;
021 import java.util.Map;
022
023
032 public class RatingsStatsWrapper implements RatingsStats,
033 ModelWrapper<RatingsStats> {
034 public RatingsStatsWrapper(RatingsStats ratingsStats) {
035 _ratingsStats = ratingsStats;
036 }
037
038 public Class<?> getModelClass() {
039 return RatingsStats.class;
040 }
041
042 public String getModelClassName() {
043 return RatingsStats.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("statsId", getStatsId());
050 attributes.put("classNameId", getClassNameId());
051 attributes.put("classPK", getClassPK());
052 attributes.put("totalEntries", getTotalEntries());
053 attributes.put("totalScore", getTotalScore());
054 attributes.put("averageScore", getAverageScore());
055
056 return attributes;
057 }
058
059 public void setModelAttributes(Map<String, Object> attributes) {
060 Long statsId = (Long)attributes.get("statsId");
061
062 if (statsId != null) {
063 setStatsId(statsId);
064 }
065
066 Long classNameId = (Long)attributes.get("classNameId");
067
068 if (classNameId != null) {
069 setClassNameId(classNameId);
070 }
071
072 Long classPK = (Long)attributes.get("classPK");
073
074 if (classPK != null) {
075 setClassPK(classPK);
076 }
077
078 Integer totalEntries = (Integer)attributes.get("totalEntries");
079
080 if (totalEntries != null) {
081 setTotalEntries(totalEntries);
082 }
083
084 Double totalScore = (Double)attributes.get("totalScore");
085
086 if (totalScore != null) {
087 setTotalScore(totalScore);
088 }
089
090 Double averageScore = (Double)attributes.get("averageScore");
091
092 if (averageScore != null) {
093 setAverageScore(averageScore);
094 }
095 }
096
097
102 public long getPrimaryKey() {
103 return _ratingsStats.getPrimaryKey();
104 }
105
106
111 public void setPrimaryKey(long primaryKey) {
112 _ratingsStats.setPrimaryKey(primaryKey);
113 }
114
115
120 public long getStatsId() {
121 return _ratingsStats.getStatsId();
122 }
123
124
129 public void setStatsId(long statsId) {
130 _ratingsStats.setStatsId(statsId);
131 }
132
133
138 public java.lang.String getClassName() {
139 return _ratingsStats.getClassName();
140 }
141
142 public void setClassName(java.lang.String className) {
143 _ratingsStats.setClassName(className);
144 }
145
146
151 public long getClassNameId() {
152 return _ratingsStats.getClassNameId();
153 }
154
155
160 public void setClassNameId(long classNameId) {
161 _ratingsStats.setClassNameId(classNameId);
162 }
163
164
169 public long getClassPK() {
170 return _ratingsStats.getClassPK();
171 }
172
173
178 public void setClassPK(long classPK) {
179 _ratingsStats.setClassPK(classPK);
180 }
181
182
187 public int getTotalEntries() {
188 return _ratingsStats.getTotalEntries();
189 }
190
191
196 public void setTotalEntries(int totalEntries) {
197 _ratingsStats.setTotalEntries(totalEntries);
198 }
199
200
205 public double getTotalScore() {
206 return _ratingsStats.getTotalScore();
207 }
208
209
214 public void setTotalScore(double totalScore) {
215 _ratingsStats.setTotalScore(totalScore);
216 }
217
218
223 public double getAverageScore() {
224 return _ratingsStats.getAverageScore();
225 }
226
227
232 public void setAverageScore(double averageScore) {
233 _ratingsStats.setAverageScore(averageScore);
234 }
235
236 public boolean isNew() {
237 return _ratingsStats.isNew();
238 }
239
240 public void setNew(boolean n) {
241 _ratingsStats.setNew(n);
242 }
243
244 public boolean isCachedModel() {
245 return _ratingsStats.isCachedModel();
246 }
247
248 public void setCachedModel(boolean cachedModel) {
249 _ratingsStats.setCachedModel(cachedModel);
250 }
251
252 public boolean isEscapedModel() {
253 return _ratingsStats.isEscapedModel();
254 }
255
256 public java.io.Serializable getPrimaryKeyObj() {
257 return _ratingsStats.getPrimaryKeyObj();
258 }
259
260 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
261 _ratingsStats.setPrimaryKeyObj(primaryKeyObj);
262 }
263
264 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
265 return _ratingsStats.getExpandoBridge();
266 }
267
268 public void setExpandoBridgeAttributes(
269 com.liferay.portal.service.ServiceContext serviceContext) {
270 _ratingsStats.setExpandoBridgeAttributes(serviceContext);
271 }
272
273 @Override
274 public java.lang.Object clone() {
275 return new RatingsStatsWrapper((RatingsStats)_ratingsStats.clone());
276 }
277
278 public int compareTo(
279 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
280 return _ratingsStats.compareTo(ratingsStats);
281 }
282
283 @Override
284 public int hashCode() {
285 return _ratingsStats.hashCode();
286 }
287
288 public com.liferay.portal.model.CacheModel<com.liferay.portlet.ratings.model.RatingsStats> toCacheModel() {
289 return _ratingsStats.toCacheModel();
290 }
291
292 public com.liferay.portlet.ratings.model.RatingsStats toEscapedModel() {
293 return new RatingsStatsWrapper(_ratingsStats.toEscapedModel());
294 }
295
296 public com.liferay.portlet.ratings.model.RatingsStats toUnescapedModel() {
297 return new RatingsStatsWrapper(_ratingsStats.toUnescapedModel());
298 }
299
300 @Override
301 public java.lang.String toString() {
302 return _ratingsStats.toString();
303 }
304
305 public java.lang.String toXmlString() {
306 return _ratingsStats.toXmlString();
307 }
308
309 public void persist()
310 throws com.liferay.portal.kernel.exception.SystemException {
311 _ratingsStats.persist();
312 }
313
314 @Override
315 public boolean equals(Object obj) {
316 if (this == obj) {
317 return true;
318 }
319
320 if (!(obj instanceof RatingsStatsWrapper)) {
321 return false;
322 }
323
324 RatingsStatsWrapper ratingsStatsWrapper = (RatingsStatsWrapper)obj;
325
326 if (Validator.equals(_ratingsStats, ratingsStatsWrapper._ratingsStats)) {
327 return true;
328 }
329
330 return false;
331 }
332
333
336 public RatingsStats getWrappedRatingsStats() {
337 return _ratingsStats;
338 }
339
340 public RatingsStats getWrappedModel() {
341 return _ratingsStats;
342 }
343
344 public void resetOriginalValues() {
345 _ratingsStats.resetOriginalValues();
346 }
347
348 private RatingsStats _ratingsStats;
349 }