001
014
015 package com.liferay.portlet.ratings.model;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.util.Validator;
020 import com.liferay.portal.model.ModelWrapper;
021
022 import java.util.HashMap;
023 import java.util.Map;
024
025
034 @ProviderType
035 public class RatingsStatsWrapper implements RatingsStats,
036 ModelWrapper<RatingsStats> {
037 public RatingsStatsWrapper(RatingsStats ratingsStats) {
038 _ratingsStats = ratingsStats;
039 }
040
041 @Override
042 public Class<?> getModelClass() {
043 return RatingsStats.class;
044 }
045
046 @Override
047 public String getModelClassName() {
048 return RatingsStats.class.getName();
049 }
050
051 @Override
052 public Map<String, Object> getModelAttributes() {
053 Map<String, Object> attributes = new HashMap<String, Object>();
054
055 attributes.put("statsId", getStatsId());
056 attributes.put("classNameId", getClassNameId());
057 attributes.put("classPK", getClassPK());
058 attributes.put("totalEntries", getTotalEntries());
059 attributes.put("totalScore", getTotalScore());
060 attributes.put("averageScore", getAverageScore());
061
062 return attributes;
063 }
064
065 @Override
066 public void setModelAttributes(Map<String, Object> attributes) {
067 Long statsId = (Long)attributes.get("statsId");
068
069 if (statsId != null) {
070 setStatsId(statsId);
071 }
072
073 Long classNameId = (Long)attributes.get("classNameId");
074
075 if (classNameId != null) {
076 setClassNameId(classNameId);
077 }
078
079 Long classPK = (Long)attributes.get("classPK");
080
081 if (classPK != null) {
082 setClassPK(classPK);
083 }
084
085 Integer totalEntries = (Integer)attributes.get("totalEntries");
086
087 if (totalEntries != null) {
088 setTotalEntries(totalEntries);
089 }
090
091 Double totalScore = (Double)attributes.get("totalScore");
092
093 if (totalScore != null) {
094 setTotalScore(totalScore);
095 }
096
097 Double averageScore = (Double)attributes.get("averageScore");
098
099 if (averageScore != null) {
100 setAverageScore(averageScore);
101 }
102 }
103
104
109 @Override
110 public long getPrimaryKey() {
111 return _ratingsStats.getPrimaryKey();
112 }
113
114
119 @Override
120 public void setPrimaryKey(long primaryKey) {
121 _ratingsStats.setPrimaryKey(primaryKey);
122 }
123
124
129 @Override
130 public long getStatsId() {
131 return _ratingsStats.getStatsId();
132 }
133
134
139 @Override
140 public void setStatsId(long statsId) {
141 _ratingsStats.setStatsId(statsId);
142 }
143
144
149 @Override
150 public java.lang.String getClassName() {
151 return _ratingsStats.getClassName();
152 }
153
154 @Override
155 public void setClassName(java.lang.String className) {
156 _ratingsStats.setClassName(className);
157 }
158
159
164 @Override
165 public long getClassNameId() {
166 return _ratingsStats.getClassNameId();
167 }
168
169
174 @Override
175 public void setClassNameId(long classNameId) {
176 _ratingsStats.setClassNameId(classNameId);
177 }
178
179
184 @Override
185 public long getClassPK() {
186 return _ratingsStats.getClassPK();
187 }
188
189
194 @Override
195 public void setClassPK(long classPK) {
196 _ratingsStats.setClassPK(classPK);
197 }
198
199
204 @Override
205 public int getTotalEntries() {
206 return _ratingsStats.getTotalEntries();
207 }
208
209
214 @Override
215 public void setTotalEntries(int totalEntries) {
216 _ratingsStats.setTotalEntries(totalEntries);
217 }
218
219
224 @Override
225 public double getTotalScore() {
226 return _ratingsStats.getTotalScore();
227 }
228
229
234 @Override
235 public void setTotalScore(double totalScore) {
236 _ratingsStats.setTotalScore(totalScore);
237 }
238
239
244 @Override
245 public double getAverageScore() {
246 return _ratingsStats.getAverageScore();
247 }
248
249
254 @Override
255 public void setAverageScore(double averageScore) {
256 _ratingsStats.setAverageScore(averageScore);
257 }
258
259 @Override
260 public boolean isNew() {
261 return _ratingsStats.isNew();
262 }
263
264 @Override
265 public void setNew(boolean n) {
266 _ratingsStats.setNew(n);
267 }
268
269 @Override
270 public boolean isCachedModel() {
271 return _ratingsStats.isCachedModel();
272 }
273
274 @Override
275 public void setCachedModel(boolean cachedModel) {
276 _ratingsStats.setCachedModel(cachedModel);
277 }
278
279 @Override
280 public boolean isEscapedModel() {
281 return _ratingsStats.isEscapedModel();
282 }
283
284 @Override
285 public java.io.Serializable getPrimaryKeyObj() {
286 return _ratingsStats.getPrimaryKeyObj();
287 }
288
289 @Override
290 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
291 _ratingsStats.setPrimaryKeyObj(primaryKeyObj);
292 }
293
294 @Override
295 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
296 return _ratingsStats.getExpandoBridge();
297 }
298
299 @Override
300 public void setExpandoBridgeAttributes(
301 com.liferay.portal.model.BaseModel<?> baseModel) {
302 _ratingsStats.setExpandoBridgeAttributes(baseModel);
303 }
304
305 @Override
306 public void setExpandoBridgeAttributes(
307 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
308 _ratingsStats.setExpandoBridgeAttributes(expandoBridge);
309 }
310
311 @Override
312 public void setExpandoBridgeAttributes(
313 com.liferay.portal.service.ServiceContext serviceContext) {
314 _ratingsStats.setExpandoBridgeAttributes(serviceContext);
315 }
316
317 @Override
318 public java.lang.Object clone() {
319 return new RatingsStatsWrapper((RatingsStats)_ratingsStats.clone());
320 }
321
322 @Override
323 public int compareTo(
324 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
325 return _ratingsStats.compareTo(ratingsStats);
326 }
327
328 @Override
329 public int hashCode() {
330 return _ratingsStats.hashCode();
331 }
332
333 @Override
334 public com.liferay.portal.model.CacheModel<com.liferay.portlet.ratings.model.RatingsStats> toCacheModel() {
335 return _ratingsStats.toCacheModel();
336 }
337
338 @Override
339 public com.liferay.portlet.ratings.model.RatingsStats toEscapedModel() {
340 return new RatingsStatsWrapper(_ratingsStats.toEscapedModel());
341 }
342
343 @Override
344 public com.liferay.portlet.ratings.model.RatingsStats toUnescapedModel() {
345 return new RatingsStatsWrapper(_ratingsStats.toUnescapedModel());
346 }
347
348 @Override
349 public java.lang.String toString() {
350 return _ratingsStats.toString();
351 }
352
353 @Override
354 public java.lang.String toXmlString() {
355 return _ratingsStats.toXmlString();
356 }
357
358 @Override
359 public void persist()
360 throws com.liferay.portal.kernel.exception.SystemException {
361 _ratingsStats.persist();
362 }
363
364 @Override
365 public boolean equals(Object obj) {
366 if (this == obj) {
367 return true;
368 }
369
370 if (!(obj instanceof RatingsStatsWrapper)) {
371 return false;
372 }
373
374 RatingsStatsWrapper ratingsStatsWrapper = (RatingsStatsWrapper)obj;
375
376 if (Validator.equals(_ratingsStats, ratingsStatsWrapper._ratingsStats)) {
377 return true;
378 }
379
380 return false;
381 }
382
383
386 public RatingsStats getWrappedRatingsStats() {
387 return _ratingsStats;
388 }
389
390 @Override
391 public RatingsStats getWrappedModel() {
392 return _ratingsStats;
393 }
394
395 @Override
396 public void resetOriginalValues() {
397 _ratingsStats.resetOriginalValues();
398 }
399
400 private RatingsStats _ratingsStats;
401 }