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