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