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 com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link RatingsStats}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       RatingsStats
029     * @generated
030     */
031    public class RatingsStatsWrapper implements RatingsStats,
032            ModelWrapper<RatingsStats> {
033            public RatingsStatsWrapper(RatingsStats ratingsStats) {
034                    _ratingsStats = ratingsStats;
035            }
036    
037            public Class<?> getModelClass() {
038                    return RatingsStats.class;
039            }
040    
041            public String getModelClassName() {
042                    return RatingsStats.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("statsId", getStatsId());
049                    attributes.put("classNameId", getClassNameId());
050                    attributes.put("classPK", getClassPK());
051                    attributes.put("totalEntries", getTotalEntries());
052                    attributes.put("totalScore", getTotalScore());
053                    attributes.put("averageScore", getAverageScore());
054    
055                    return attributes;
056            }
057    
058            public void setModelAttributes(Map<String, Object> attributes) {
059                    Long statsId = (Long)attributes.get("statsId");
060    
061                    if (statsId != null) {
062                            setStatsId(statsId);
063                    }
064    
065                    Long classNameId = (Long)attributes.get("classNameId");
066    
067                    if (classNameId != null) {
068                            setClassNameId(classNameId);
069                    }
070    
071                    Long classPK = (Long)attributes.get("classPK");
072    
073                    if (classPK != null) {
074                            setClassPK(classPK);
075                    }
076    
077                    Integer totalEntries = (Integer)attributes.get("totalEntries");
078    
079                    if (totalEntries != null) {
080                            setTotalEntries(totalEntries);
081                    }
082    
083                    Double totalScore = (Double)attributes.get("totalScore");
084    
085                    if (totalScore != null) {
086                            setTotalScore(totalScore);
087                    }
088    
089                    Double averageScore = (Double)attributes.get("averageScore");
090    
091                    if (averageScore != null) {
092                            setAverageScore(averageScore);
093                    }
094            }
095    
096            /**
097            * Returns the primary key of this ratings stats.
098            *
099            * @return the primary key of this ratings stats
100            */
101            public long getPrimaryKey() {
102                    return _ratingsStats.getPrimaryKey();
103            }
104    
105            /**
106            * Sets the primary key of this ratings stats.
107            *
108            * @param primaryKey the primary key of this ratings stats
109            */
110            public void setPrimaryKey(long primaryKey) {
111                    _ratingsStats.setPrimaryKey(primaryKey);
112            }
113    
114            /**
115            * Returns the stats ID of this ratings stats.
116            *
117            * @return the stats ID of this ratings stats
118            */
119            public long getStatsId() {
120                    return _ratingsStats.getStatsId();
121            }
122    
123            /**
124            * Sets the stats ID of this ratings stats.
125            *
126            * @param statsId the stats ID of this ratings stats
127            */
128            public void setStatsId(long statsId) {
129                    _ratingsStats.setStatsId(statsId);
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            public java.lang.String getClassName() {
138                    return _ratingsStats.getClassName();
139            }
140    
141            public void setClassName(java.lang.String className) {
142                    _ratingsStats.setClassName(className);
143            }
144    
145            /**
146            * Returns the class name ID of this ratings stats.
147            *
148            * @return the class name ID of this ratings stats
149            */
150            public long getClassNameId() {
151                    return _ratingsStats.getClassNameId();
152            }
153    
154            /**
155            * Sets the class name ID of this ratings stats.
156            *
157            * @param classNameId the class name ID of this ratings stats
158            */
159            public void setClassNameId(long classNameId) {
160                    _ratingsStats.setClassNameId(classNameId);
161            }
162    
163            /**
164            * Returns the class p k of this ratings stats.
165            *
166            * @return the class p k of this ratings stats
167            */
168            public long getClassPK() {
169                    return _ratingsStats.getClassPK();
170            }
171    
172            /**
173            * Sets the class p k of this ratings stats.
174            *
175            * @param classPK the class p k of this ratings stats
176            */
177            public void setClassPK(long classPK) {
178                    _ratingsStats.setClassPK(classPK);
179            }
180    
181            /**
182            * Returns the total entries of this ratings stats.
183            *
184            * @return the total entries of this ratings stats
185            */
186            public int getTotalEntries() {
187                    return _ratingsStats.getTotalEntries();
188            }
189    
190            /**
191            * Sets the total entries of this ratings stats.
192            *
193            * @param totalEntries the total entries of this ratings stats
194            */
195            public void setTotalEntries(int totalEntries) {
196                    _ratingsStats.setTotalEntries(totalEntries);
197            }
198    
199            /**
200            * Returns the total score of this ratings stats.
201            *
202            * @return the total score of this ratings stats
203            */
204            public double getTotalScore() {
205                    return _ratingsStats.getTotalScore();
206            }
207    
208            /**
209            * Sets the total score of this ratings stats.
210            *
211            * @param totalScore the total score of this ratings stats
212            */
213            public void setTotalScore(double totalScore) {
214                    _ratingsStats.setTotalScore(totalScore);
215            }
216    
217            /**
218            * Returns the average score of this ratings stats.
219            *
220            * @return the average score of this ratings stats
221            */
222            public double getAverageScore() {
223                    return _ratingsStats.getAverageScore();
224            }
225    
226            /**
227            * Sets the average score of this ratings stats.
228            *
229            * @param averageScore the average score of this ratings stats
230            */
231            public void setAverageScore(double averageScore) {
232                    _ratingsStats.setAverageScore(averageScore);
233            }
234    
235            public boolean isNew() {
236                    return _ratingsStats.isNew();
237            }
238    
239            public void setNew(boolean n) {
240                    _ratingsStats.setNew(n);
241            }
242    
243            public boolean isCachedModel() {
244                    return _ratingsStats.isCachedModel();
245            }
246    
247            public void setCachedModel(boolean cachedModel) {
248                    _ratingsStats.setCachedModel(cachedModel);
249            }
250    
251            public boolean isEscapedModel() {
252                    return _ratingsStats.isEscapedModel();
253            }
254    
255            public java.io.Serializable getPrimaryKeyObj() {
256                    return _ratingsStats.getPrimaryKeyObj();
257            }
258    
259            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
260                    _ratingsStats.setPrimaryKeyObj(primaryKeyObj);
261            }
262    
263            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
264                    return _ratingsStats.getExpandoBridge();
265            }
266    
267            public void setExpandoBridgeAttributes(
268                    com.liferay.portal.model.BaseModel<?> baseModel) {
269                    _ratingsStats.setExpandoBridgeAttributes(baseModel);
270            }
271    
272            public void setExpandoBridgeAttributes(
273                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
274                    _ratingsStats.setExpandoBridgeAttributes(expandoBridge);
275            }
276    
277            public void setExpandoBridgeAttributes(
278                    com.liferay.portal.service.ServiceContext serviceContext) {
279                    _ratingsStats.setExpandoBridgeAttributes(serviceContext);
280            }
281    
282            @Override
283            public java.lang.Object clone() {
284                    return new RatingsStatsWrapper((RatingsStats)_ratingsStats.clone());
285            }
286    
287            public int compareTo(
288                    com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
289                    return _ratingsStats.compareTo(ratingsStats);
290            }
291    
292            @Override
293            public int hashCode() {
294                    return _ratingsStats.hashCode();
295            }
296    
297            public com.liferay.portal.model.CacheModel<com.liferay.portlet.ratings.model.RatingsStats> toCacheModel() {
298                    return _ratingsStats.toCacheModel();
299            }
300    
301            public com.liferay.portlet.ratings.model.RatingsStats toEscapedModel() {
302                    return new RatingsStatsWrapper(_ratingsStats.toEscapedModel());
303            }
304    
305            public com.liferay.portlet.ratings.model.RatingsStats toUnescapedModel() {
306                    return new RatingsStatsWrapper(_ratingsStats.toUnescapedModel());
307            }
308    
309            @Override
310            public java.lang.String toString() {
311                    return _ratingsStats.toString();
312            }
313    
314            public java.lang.String toXmlString() {
315                    return _ratingsStats.toXmlString();
316            }
317    
318            public void persist()
319                    throws com.liferay.portal.kernel.exception.SystemException {
320                    _ratingsStats.persist();
321            }
322    
323            /**
324             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
325             */
326            public RatingsStats getWrappedRatingsStats() {
327                    return _ratingsStats;
328            }
329    
330            public RatingsStats getWrappedModel() {
331                    return _ratingsStats;
332            }
333    
334            public void resetOriginalValues() {
335                    _ratingsStats.resetOriginalValues();
336            }
337    
338            private RatingsStats _ratingsStats;
339    }