001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
026     * <p>
027     * This class is a wrapper for {@link RatingsStats}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see RatingsStats
032     * @generated
033     */
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("companyId", getCompanyId());
057                    attributes.put("classNameId", getClassNameId());
058                    attributes.put("classPK", getClassPK());
059                    attributes.put("totalEntries", getTotalEntries());
060                    attributes.put("totalScore", getTotalScore());
061                    attributes.put("averageScore", getAverageScore());
062    
063                    return attributes;
064            }
065    
066            @Override
067            public void setModelAttributes(Map<String, Object> attributes) {
068                    Long statsId = (Long)attributes.get("statsId");
069    
070                    if (statsId != null) {
071                            setStatsId(statsId);
072                    }
073    
074                    Long companyId = (Long)attributes.get("companyId");
075    
076                    if (companyId != null) {
077                            setCompanyId(companyId);
078                    }
079    
080                    Long classNameId = (Long)attributes.get("classNameId");
081    
082                    if (classNameId != null) {
083                            setClassNameId(classNameId);
084                    }
085    
086                    Long classPK = (Long)attributes.get("classPK");
087    
088                    if (classPK != null) {
089                            setClassPK(classPK);
090                    }
091    
092                    Integer totalEntries = (Integer)attributes.get("totalEntries");
093    
094                    if (totalEntries != null) {
095                            setTotalEntries(totalEntries);
096                    }
097    
098                    Double totalScore = (Double)attributes.get("totalScore");
099    
100                    if (totalScore != null) {
101                            setTotalScore(totalScore);
102                    }
103    
104                    Double averageScore = (Double)attributes.get("averageScore");
105    
106                    if (averageScore != null) {
107                            setAverageScore(averageScore);
108                    }
109            }
110    
111            @Override
112            public java.lang.Object clone() {
113                    return new RatingsStatsWrapper((RatingsStats)_ratingsStats.clone());
114            }
115    
116            @Override
117            public int compareTo(
118                    com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
119                    return _ratingsStats.compareTo(ratingsStats);
120            }
121    
122            /**
123            * Returns the average score of this ratings stats.
124            *
125            * @return the average score of this ratings stats
126            */
127            @Override
128            public double getAverageScore() {
129                    return _ratingsStats.getAverageScore();
130            }
131    
132            /**
133            * Returns the fully qualified class name of this ratings stats.
134            *
135            * @return the fully qualified class name of this ratings stats
136            */
137            @Override
138            public java.lang.String getClassName() {
139                    return _ratingsStats.getClassName();
140            }
141    
142            /**
143            * Returns the class name ID of this ratings stats.
144            *
145            * @return the class name ID of this ratings stats
146            */
147            @Override
148            public long getClassNameId() {
149                    return _ratingsStats.getClassNameId();
150            }
151    
152            /**
153            * Returns the class p k of this ratings stats.
154            *
155            * @return the class p k of this ratings stats
156            */
157            @Override
158            public long getClassPK() {
159                    return _ratingsStats.getClassPK();
160            }
161    
162            /**
163            * Returns the company ID of this ratings stats.
164            *
165            * @return the company ID of this ratings stats
166            */
167            @Override
168            public long getCompanyId() {
169                    return _ratingsStats.getCompanyId();
170            }
171    
172            @Override
173            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
174                    return _ratingsStats.getExpandoBridge();
175            }
176    
177            /**
178            * Returns the primary key of this ratings stats.
179            *
180            * @return the primary key of this ratings stats
181            */
182            @Override
183            public long getPrimaryKey() {
184                    return _ratingsStats.getPrimaryKey();
185            }
186    
187            @Override
188            public java.io.Serializable getPrimaryKeyObj() {
189                    return _ratingsStats.getPrimaryKeyObj();
190            }
191    
192            /**
193            * Returns the stats ID of this ratings stats.
194            *
195            * @return the stats ID of this ratings stats
196            */
197            @Override
198            public long getStatsId() {
199                    return _ratingsStats.getStatsId();
200            }
201    
202            /**
203            * Returns the total entries of this ratings stats.
204            *
205            * @return the total entries of this ratings stats
206            */
207            @Override
208            public int getTotalEntries() {
209                    return _ratingsStats.getTotalEntries();
210            }
211    
212            /**
213            * Returns the total score of this ratings stats.
214            *
215            * @return the total score of this ratings stats
216            */
217            @Override
218            public double getTotalScore() {
219                    return _ratingsStats.getTotalScore();
220            }
221    
222            @Override
223            public int hashCode() {
224                    return _ratingsStats.hashCode();
225            }
226    
227            @Override
228            public boolean isCachedModel() {
229                    return _ratingsStats.isCachedModel();
230            }
231    
232            @Override
233            public boolean isEscapedModel() {
234                    return _ratingsStats.isEscapedModel();
235            }
236    
237            @Override
238            public boolean isNew() {
239                    return _ratingsStats.isNew();
240            }
241    
242            @Override
243            public void persist() {
244                    _ratingsStats.persist();
245            }
246    
247            /**
248            * Sets the average score of this ratings stats.
249            *
250            * @param averageScore the average score of this ratings stats
251            */
252            @Override
253            public void setAverageScore(double averageScore) {
254                    _ratingsStats.setAverageScore(averageScore);
255            }
256    
257            @Override
258            public void setCachedModel(boolean cachedModel) {
259                    _ratingsStats.setCachedModel(cachedModel);
260            }
261    
262            @Override
263            public void setClassName(java.lang.String className) {
264                    _ratingsStats.setClassName(className);
265            }
266    
267            /**
268            * Sets the class name ID of this ratings stats.
269            *
270            * @param classNameId the class name ID of this ratings stats
271            */
272            @Override
273            public void setClassNameId(long classNameId) {
274                    _ratingsStats.setClassNameId(classNameId);
275            }
276    
277            /**
278            * Sets the class p k of this ratings stats.
279            *
280            * @param classPK the class p k of this ratings stats
281            */
282            @Override
283            public void setClassPK(long classPK) {
284                    _ratingsStats.setClassPK(classPK);
285            }
286    
287            /**
288            * Sets the company ID of this ratings stats.
289            *
290            * @param companyId the company ID of this ratings stats
291            */
292            @Override
293            public void setCompanyId(long companyId) {
294                    _ratingsStats.setCompanyId(companyId);
295            }
296    
297            @Override
298            public void setExpandoBridgeAttributes(
299                    com.liferay.portal.model.BaseModel<?> baseModel) {
300                    _ratingsStats.setExpandoBridgeAttributes(baseModel);
301            }
302    
303            @Override
304            public void setExpandoBridgeAttributes(
305                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
306                    _ratingsStats.setExpandoBridgeAttributes(expandoBridge);
307            }
308    
309            @Override
310            public void setExpandoBridgeAttributes(
311                    com.liferay.portal.service.ServiceContext serviceContext) {
312                    _ratingsStats.setExpandoBridgeAttributes(serviceContext);
313            }
314    
315            @Override
316            public void setNew(boolean n) {
317                    _ratingsStats.setNew(n);
318            }
319    
320            /**
321            * Sets the primary key of this ratings stats.
322            *
323            * @param primaryKey the primary key of this ratings stats
324            */
325            @Override
326            public void setPrimaryKey(long primaryKey) {
327                    _ratingsStats.setPrimaryKey(primaryKey);
328            }
329    
330            @Override
331            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
332                    _ratingsStats.setPrimaryKeyObj(primaryKeyObj);
333            }
334    
335            /**
336            * Sets the stats ID of this ratings stats.
337            *
338            * @param statsId the stats ID of this ratings stats
339            */
340            @Override
341            public void setStatsId(long statsId) {
342                    _ratingsStats.setStatsId(statsId);
343            }
344    
345            /**
346            * Sets the total entries of this ratings stats.
347            *
348            * @param totalEntries the total entries of this ratings stats
349            */
350            @Override
351            public void setTotalEntries(int totalEntries) {
352                    _ratingsStats.setTotalEntries(totalEntries);
353            }
354    
355            /**
356            * Sets the total score of this ratings stats.
357            *
358            * @param totalScore the total score of this ratings stats
359            */
360            @Override
361            public void setTotalScore(double totalScore) {
362                    _ratingsStats.setTotalScore(totalScore);
363            }
364    
365            @Override
366            public com.liferay.portal.model.CacheModel<com.liferay.portlet.ratings.model.RatingsStats> toCacheModel() {
367                    return _ratingsStats.toCacheModel();
368            }
369    
370            @Override
371            public com.liferay.portlet.ratings.model.RatingsStats toEscapedModel() {
372                    return new RatingsStatsWrapper(_ratingsStats.toEscapedModel());
373            }
374    
375            @Override
376            public java.lang.String toString() {
377                    return _ratingsStats.toString();
378            }
379    
380            @Override
381            public com.liferay.portlet.ratings.model.RatingsStats toUnescapedModel() {
382                    return new RatingsStatsWrapper(_ratingsStats.toUnescapedModel());
383            }
384    
385            @Override
386            public java.lang.String toXmlString() {
387                    return _ratingsStats.toXmlString();
388            }
389    
390            @Override
391            public boolean equals(Object obj) {
392                    if (this == obj) {
393                            return true;
394                    }
395    
396                    if (!(obj instanceof RatingsStatsWrapper)) {
397                            return false;
398                    }
399    
400                    RatingsStatsWrapper ratingsStatsWrapper = (RatingsStatsWrapper)obj;
401    
402                    if (Validator.equals(_ratingsStats, ratingsStatsWrapper._ratingsStats)) {
403                            return true;
404                    }
405    
406                    return false;
407            }
408    
409            @Override
410            public RatingsStats getWrappedModel() {
411                    return _ratingsStats;
412            }
413    
414            @Override
415            public boolean isEntityCacheEnabled() {
416                    return _ratingsStats.isEntityCacheEnabled();
417            }
418    
419            @Override
420            public boolean isFinderCacheEnabled() {
421                    return _ratingsStats.isFinderCacheEnabled();
422            }
423    
424            @Override
425            public void resetOriginalValues() {
426                    _ratingsStats.resetOriginalValues();
427            }
428    
429            private final RatingsStats _ratingsStats;
430    }