001    /**
002     * Copyright (c) 2000-2013 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("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            /**
105            * Returns the primary key of this ratings stats.
106            *
107            * @return the primary key of this ratings stats
108            */
109            @Override
110            public long getPrimaryKey() {
111                    return _ratingsStats.getPrimaryKey();
112            }
113    
114            /**
115            * Sets the primary key of this ratings stats.
116            *
117            * @param primaryKey the primary key of this ratings stats
118            */
119            @Override
120            public void setPrimaryKey(long primaryKey) {
121                    _ratingsStats.setPrimaryKey(primaryKey);
122            }
123    
124            /**
125            * Returns the stats ID of this ratings stats.
126            *
127            * @return the stats ID of this ratings stats
128            */
129            @Override
130            public long getStatsId() {
131                    return _ratingsStats.getStatsId();
132            }
133    
134            /**
135            * Sets the stats ID of this ratings stats.
136            *
137            * @param statsId the stats ID of this ratings stats
138            */
139            @Override
140            public void setStatsId(long statsId) {
141                    _ratingsStats.setStatsId(statsId);
142            }
143    
144            /**
145            * Returns the fully qualified class name of this ratings stats.
146            *
147            * @return the fully qualified class name of this ratings stats
148            */
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            /**
160            * Returns the class name ID of this ratings stats.
161            *
162            * @return the class name ID of this ratings stats
163            */
164            @Override
165            public long getClassNameId() {
166                    return _ratingsStats.getClassNameId();
167            }
168    
169            /**
170            * Sets the class name ID of this ratings stats.
171            *
172            * @param classNameId the class name ID of this ratings stats
173            */
174            @Override
175            public void setClassNameId(long classNameId) {
176                    _ratingsStats.setClassNameId(classNameId);
177            }
178    
179            /**
180            * Returns the class p k of this ratings stats.
181            *
182            * @return the class p k of this ratings stats
183            */
184            @Override
185            public long getClassPK() {
186                    return _ratingsStats.getClassPK();
187            }
188    
189            /**
190            * Sets the class p k of this ratings stats.
191            *
192            * @param classPK the class p k of this ratings stats
193            */
194            @Override
195            public void setClassPK(long classPK) {
196                    _ratingsStats.setClassPK(classPK);
197            }
198    
199            /**
200            * Returns the total entries of this ratings stats.
201            *
202            * @return the total entries of this ratings stats
203            */
204            @Override
205            public int getTotalEntries() {
206                    return _ratingsStats.getTotalEntries();
207            }
208    
209            /**
210            * Sets the total entries of this ratings stats.
211            *
212            * @param totalEntries the total entries of this ratings stats
213            */
214            @Override
215            public void setTotalEntries(int totalEntries) {
216                    _ratingsStats.setTotalEntries(totalEntries);
217            }
218    
219            /**
220            * Returns the total score of this ratings stats.
221            *
222            * @return the total score of this ratings stats
223            */
224            @Override
225            public double getTotalScore() {
226                    return _ratingsStats.getTotalScore();
227            }
228    
229            /**
230            * Sets the total score of this ratings stats.
231            *
232            * @param totalScore the total score of this ratings stats
233            */
234            @Override
235            public void setTotalScore(double totalScore) {
236                    _ratingsStats.setTotalScore(totalScore);
237            }
238    
239            /**
240            * Returns the average score of this ratings stats.
241            *
242            * @return the average score of this ratings stats
243            */
244            @Override
245            public double getAverageScore() {
246                    return _ratingsStats.getAverageScore();
247            }
248    
249            /**
250            * Sets the average score of this ratings stats.
251            *
252            * @param averageScore the average score of this ratings stats
253            */
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            /**
384             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
385             */
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    }