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.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link RatingsEntry}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see RatingsEntry
031     * @generated
032     */
033    public class RatingsEntryWrapper implements RatingsEntry,
034            ModelWrapper<RatingsEntry> {
035            public RatingsEntryWrapper(RatingsEntry ratingsEntry) {
036                    _ratingsEntry = ratingsEntry;
037            }
038    
039            @Override
040            public Class<?> getModelClass() {
041                    return RatingsEntry.class;
042            }
043    
044            @Override
045            public String getModelClassName() {
046                    return RatingsEntry.class.getName();
047            }
048    
049            @Override
050            public Map<String, Object> getModelAttributes() {
051                    Map<String, Object> attributes = new HashMap<String, Object>();
052    
053                    attributes.put("entryId", getEntryId());
054                    attributes.put("companyId", getCompanyId());
055                    attributes.put("userId", getUserId());
056                    attributes.put("userName", getUserName());
057                    attributes.put("createDate", getCreateDate());
058                    attributes.put("modifiedDate", getModifiedDate());
059                    attributes.put("classNameId", getClassNameId());
060                    attributes.put("classPK", getClassPK());
061                    attributes.put("score", getScore());
062    
063                    return attributes;
064            }
065    
066            @Override
067            public void setModelAttributes(Map<String, Object> attributes) {
068                    Long entryId = (Long)attributes.get("entryId");
069    
070                    if (entryId != null) {
071                            setEntryId(entryId);
072                    }
073    
074                    Long companyId = (Long)attributes.get("companyId");
075    
076                    if (companyId != null) {
077                            setCompanyId(companyId);
078                    }
079    
080                    Long userId = (Long)attributes.get("userId");
081    
082                    if (userId != null) {
083                            setUserId(userId);
084                    }
085    
086                    String userName = (String)attributes.get("userName");
087    
088                    if (userName != null) {
089                            setUserName(userName);
090                    }
091    
092                    Date createDate = (Date)attributes.get("createDate");
093    
094                    if (createDate != null) {
095                            setCreateDate(createDate);
096                    }
097    
098                    Date modifiedDate = (Date)attributes.get("modifiedDate");
099    
100                    if (modifiedDate != null) {
101                            setModifiedDate(modifiedDate);
102                    }
103    
104                    Long classNameId = (Long)attributes.get("classNameId");
105    
106                    if (classNameId != null) {
107                            setClassNameId(classNameId);
108                    }
109    
110                    Long classPK = (Long)attributes.get("classPK");
111    
112                    if (classPK != null) {
113                            setClassPK(classPK);
114                    }
115    
116                    Double score = (Double)attributes.get("score");
117    
118                    if (score != null) {
119                            setScore(score);
120                    }
121            }
122    
123            /**
124            * Returns the primary key of this ratings entry.
125            *
126            * @return the primary key of this ratings entry
127            */
128            @Override
129            public long getPrimaryKey() {
130                    return _ratingsEntry.getPrimaryKey();
131            }
132    
133            /**
134            * Sets the primary key of this ratings entry.
135            *
136            * @param primaryKey the primary key of this ratings entry
137            */
138            @Override
139            public void setPrimaryKey(long primaryKey) {
140                    _ratingsEntry.setPrimaryKey(primaryKey);
141            }
142    
143            /**
144            * Returns the entry ID of this ratings entry.
145            *
146            * @return the entry ID of this ratings entry
147            */
148            @Override
149            public long getEntryId() {
150                    return _ratingsEntry.getEntryId();
151            }
152    
153            /**
154            * Sets the entry ID of this ratings entry.
155            *
156            * @param entryId the entry ID of this ratings entry
157            */
158            @Override
159            public void setEntryId(long entryId) {
160                    _ratingsEntry.setEntryId(entryId);
161            }
162    
163            /**
164            * Returns the company ID of this ratings entry.
165            *
166            * @return the company ID of this ratings entry
167            */
168            @Override
169            public long getCompanyId() {
170                    return _ratingsEntry.getCompanyId();
171            }
172    
173            /**
174            * Sets the company ID of this ratings entry.
175            *
176            * @param companyId the company ID of this ratings entry
177            */
178            @Override
179            public void setCompanyId(long companyId) {
180                    _ratingsEntry.setCompanyId(companyId);
181            }
182    
183            /**
184            * Returns the user ID of this ratings entry.
185            *
186            * @return the user ID of this ratings entry
187            */
188            @Override
189            public long getUserId() {
190                    return _ratingsEntry.getUserId();
191            }
192    
193            /**
194            * Sets the user ID of this ratings entry.
195            *
196            * @param userId the user ID of this ratings entry
197            */
198            @Override
199            public void setUserId(long userId) {
200                    _ratingsEntry.setUserId(userId);
201            }
202    
203            /**
204            * Returns the user uuid of this ratings entry.
205            *
206            * @return the user uuid of this ratings entry
207            * @throws SystemException if a system exception occurred
208            */
209            @Override
210            public java.lang.String getUserUuid()
211                    throws com.liferay.portal.kernel.exception.SystemException {
212                    return _ratingsEntry.getUserUuid();
213            }
214    
215            /**
216            * Sets the user uuid of this ratings entry.
217            *
218            * @param userUuid the user uuid of this ratings entry
219            */
220            @Override
221            public void setUserUuid(java.lang.String userUuid) {
222                    _ratingsEntry.setUserUuid(userUuid);
223            }
224    
225            /**
226            * Returns the user name of this ratings entry.
227            *
228            * @return the user name of this ratings entry
229            */
230            @Override
231            public java.lang.String getUserName() {
232                    return _ratingsEntry.getUserName();
233            }
234    
235            /**
236            * Sets the user name of this ratings entry.
237            *
238            * @param userName the user name of this ratings entry
239            */
240            @Override
241            public void setUserName(java.lang.String userName) {
242                    _ratingsEntry.setUserName(userName);
243            }
244    
245            /**
246            * Returns the create date of this ratings entry.
247            *
248            * @return the create date of this ratings entry
249            */
250            @Override
251            public java.util.Date getCreateDate() {
252                    return _ratingsEntry.getCreateDate();
253            }
254    
255            /**
256            * Sets the create date of this ratings entry.
257            *
258            * @param createDate the create date of this ratings entry
259            */
260            @Override
261            public void setCreateDate(java.util.Date createDate) {
262                    _ratingsEntry.setCreateDate(createDate);
263            }
264    
265            /**
266            * Returns the modified date of this ratings entry.
267            *
268            * @return the modified date of this ratings entry
269            */
270            @Override
271            public java.util.Date getModifiedDate() {
272                    return _ratingsEntry.getModifiedDate();
273            }
274    
275            /**
276            * Sets the modified date of this ratings entry.
277            *
278            * @param modifiedDate the modified date of this ratings entry
279            */
280            @Override
281            public void setModifiedDate(java.util.Date modifiedDate) {
282                    _ratingsEntry.setModifiedDate(modifiedDate);
283            }
284    
285            /**
286            * Returns the fully qualified class name of this ratings entry.
287            *
288            * @return the fully qualified class name of this ratings entry
289            */
290            @Override
291            public java.lang.String getClassName() {
292                    return _ratingsEntry.getClassName();
293            }
294    
295            @Override
296            public void setClassName(java.lang.String className) {
297                    _ratingsEntry.setClassName(className);
298            }
299    
300            /**
301            * Returns the class name ID of this ratings entry.
302            *
303            * @return the class name ID of this ratings entry
304            */
305            @Override
306            public long getClassNameId() {
307                    return _ratingsEntry.getClassNameId();
308            }
309    
310            /**
311            * Sets the class name ID of this ratings entry.
312            *
313            * @param classNameId the class name ID of this ratings entry
314            */
315            @Override
316            public void setClassNameId(long classNameId) {
317                    _ratingsEntry.setClassNameId(classNameId);
318            }
319    
320            /**
321            * Returns the class p k of this ratings entry.
322            *
323            * @return the class p k of this ratings entry
324            */
325            @Override
326            public long getClassPK() {
327                    return _ratingsEntry.getClassPK();
328            }
329    
330            /**
331            * Sets the class p k of this ratings entry.
332            *
333            * @param classPK the class p k of this ratings entry
334            */
335            @Override
336            public void setClassPK(long classPK) {
337                    _ratingsEntry.setClassPK(classPK);
338            }
339    
340            /**
341            * Returns the score of this ratings entry.
342            *
343            * @return the score of this ratings entry
344            */
345            @Override
346            public double getScore() {
347                    return _ratingsEntry.getScore();
348            }
349    
350            /**
351            * Sets the score of this ratings entry.
352            *
353            * @param score the score of this ratings entry
354            */
355            @Override
356            public void setScore(double score) {
357                    _ratingsEntry.setScore(score);
358            }
359    
360            @Override
361            public boolean isNew() {
362                    return _ratingsEntry.isNew();
363            }
364    
365            @Override
366            public void setNew(boolean n) {
367                    _ratingsEntry.setNew(n);
368            }
369    
370            @Override
371            public boolean isCachedModel() {
372                    return _ratingsEntry.isCachedModel();
373            }
374    
375            @Override
376            public void setCachedModel(boolean cachedModel) {
377                    _ratingsEntry.setCachedModel(cachedModel);
378            }
379    
380            @Override
381            public boolean isEscapedModel() {
382                    return _ratingsEntry.isEscapedModel();
383            }
384    
385            @Override
386            public java.io.Serializable getPrimaryKeyObj() {
387                    return _ratingsEntry.getPrimaryKeyObj();
388            }
389    
390            @Override
391            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
392                    _ratingsEntry.setPrimaryKeyObj(primaryKeyObj);
393            }
394    
395            @Override
396            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
397                    return _ratingsEntry.getExpandoBridge();
398            }
399    
400            @Override
401            public void setExpandoBridgeAttributes(
402                    com.liferay.portal.model.BaseModel<?> baseModel) {
403                    _ratingsEntry.setExpandoBridgeAttributes(baseModel);
404            }
405    
406            @Override
407            public void setExpandoBridgeAttributes(
408                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
409                    _ratingsEntry.setExpandoBridgeAttributes(expandoBridge);
410            }
411    
412            @Override
413            public void setExpandoBridgeAttributes(
414                    com.liferay.portal.service.ServiceContext serviceContext) {
415                    _ratingsEntry.setExpandoBridgeAttributes(serviceContext);
416            }
417    
418            @Override
419            public java.lang.Object clone() {
420                    return new RatingsEntryWrapper((RatingsEntry)_ratingsEntry.clone());
421            }
422    
423            @Override
424            public int compareTo(
425                    com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) {
426                    return _ratingsEntry.compareTo(ratingsEntry);
427            }
428    
429            @Override
430            public int hashCode() {
431                    return _ratingsEntry.hashCode();
432            }
433    
434            @Override
435            public com.liferay.portal.model.CacheModel<com.liferay.portlet.ratings.model.RatingsEntry> toCacheModel() {
436                    return _ratingsEntry.toCacheModel();
437            }
438    
439            @Override
440            public com.liferay.portlet.ratings.model.RatingsEntry toEscapedModel() {
441                    return new RatingsEntryWrapper(_ratingsEntry.toEscapedModel());
442            }
443    
444            @Override
445            public com.liferay.portlet.ratings.model.RatingsEntry toUnescapedModel() {
446                    return new RatingsEntryWrapper(_ratingsEntry.toUnescapedModel());
447            }
448    
449            @Override
450            public java.lang.String toString() {
451                    return _ratingsEntry.toString();
452            }
453    
454            @Override
455            public java.lang.String toXmlString() {
456                    return _ratingsEntry.toXmlString();
457            }
458    
459            @Override
460            public void persist()
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    _ratingsEntry.persist();
463            }
464    
465            @Override
466            public boolean equals(Object obj) {
467                    if (this == obj) {
468                            return true;
469                    }
470    
471                    if (!(obj instanceof RatingsEntryWrapper)) {
472                            return false;
473                    }
474    
475                    RatingsEntryWrapper ratingsEntryWrapper = (RatingsEntryWrapper)obj;
476    
477                    if (Validator.equals(_ratingsEntry, ratingsEntryWrapper._ratingsEntry)) {
478                            return true;
479                    }
480    
481                    return false;
482            }
483    
484            /**
485             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
486             */
487            public RatingsEntry getWrappedRatingsEntry() {
488                    return _ratingsEntry;
489            }
490    
491            @Override
492            public RatingsEntry getWrappedModel() {
493                    return _ratingsEntry;
494            }
495    
496            @Override
497            public void resetOriginalValues() {
498                    _ratingsEntry.resetOriginalValues();
499            }
500    
501            private RatingsEntry _ratingsEntry;
502    }