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