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