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.kernel.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link RatingsStats}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       RatingsStats
030     * @generated
031     */
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            /**
098            * Returns the primary key of this ratings stats.
099            *
100            * @return the primary key of this ratings stats
101            */
102            public long getPrimaryKey() {
103                    return _ratingsStats.getPrimaryKey();
104            }
105    
106            /**
107            * Sets the primary key of this ratings stats.
108            *
109            * @param primaryKey the primary key of this ratings stats
110            */
111            public void setPrimaryKey(long primaryKey) {
112                    _ratingsStats.setPrimaryKey(primaryKey);
113            }
114    
115            /**
116            * Returns the stats ID of this ratings stats.
117            *
118            * @return the stats ID of this ratings stats
119            */
120            public long getStatsId() {
121                    return _ratingsStats.getStatsId();
122            }
123    
124            /**
125            * Sets the stats ID of this ratings stats.
126            *
127            * @param statsId the stats ID of this ratings stats
128            */
129            public void setStatsId(long statsId) {
130                    _ratingsStats.setStatsId(statsId);
131            }
132    
133            /**
134            * Returns the fully qualified class name of this ratings stats.
135            *
136            * @return the fully qualified class name of this ratings stats
137            */
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            /**
147            * Returns the class name ID of this ratings stats.
148            *
149            * @return the class name ID of this ratings stats
150            */
151            public long getClassNameId() {
152                    return _ratingsStats.getClassNameId();
153            }
154    
155            /**
156            * Sets the class name ID of this ratings stats.
157            *
158            * @param classNameId the class name ID of this ratings stats
159            */
160            public void setClassNameId(long classNameId) {
161                    _ratingsStats.setClassNameId(classNameId);
162            }
163    
164            /**
165            * Returns the class p k of this ratings stats.
166            *
167            * @return the class p k of this ratings stats
168            */
169            public long getClassPK() {
170                    return _ratingsStats.getClassPK();
171            }
172    
173            /**
174            * Sets the class p k of this ratings stats.
175            *
176            * @param classPK the class p k of this ratings stats
177            */
178            public void setClassPK(long classPK) {
179                    _ratingsStats.setClassPK(classPK);
180            }
181    
182            /**
183            * Returns the total entries of this ratings stats.
184            *
185            * @return the total entries of this ratings stats
186            */
187            public int getTotalEntries() {
188                    return _ratingsStats.getTotalEntries();
189            }
190    
191            /**
192            * Sets the total entries of this ratings stats.
193            *
194            * @param totalEntries the total entries of this ratings stats
195            */
196            public void setTotalEntries(int totalEntries) {
197                    _ratingsStats.setTotalEntries(totalEntries);
198            }
199    
200            /**
201            * Returns the total score of this ratings stats.
202            *
203            * @return the total score of this ratings stats
204            */
205            public double getTotalScore() {
206                    return _ratingsStats.getTotalScore();
207            }
208    
209            /**
210            * Sets the total score of this ratings stats.
211            *
212            * @param totalScore the total score of this ratings stats
213            */
214            public void setTotalScore(double totalScore) {
215                    _ratingsStats.setTotalScore(totalScore);
216            }
217    
218            /**
219            * Returns the average score of this ratings stats.
220            *
221            * @return the average score of this ratings stats
222            */
223            public double getAverageScore() {
224                    return _ratingsStats.getAverageScore();
225            }
226    
227            /**
228            * Sets the average score of this ratings stats.
229            *
230            * @param averageScore the average score of this ratings stats
231            */
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            /**
334             * @deprecated Renamed to {@link #getWrappedModel}
335             */
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    }