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