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