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