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    
026    import java.io.Serializable;
027    
028    import java.util.Date;
029    import java.util.HashMap;
030    import java.util.Map;
031    import java.util.Objects;
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 RatingsEntry toEscapedModel() {
142                    return new RatingsEntryWrapper(_ratingsEntry.toEscapedModel());
143            }
144    
145            @Override
146            public RatingsEntry toUnescapedModel() {
147                    return new RatingsEntryWrapper(_ratingsEntry.toUnescapedModel());
148            }
149    
150            @Override
151            public boolean isCachedModel() {
152                    return _ratingsEntry.isCachedModel();
153            }
154    
155            @Override
156            public boolean isEscapedModel() {
157                    return _ratingsEntry.isEscapedModel();
158            }
159    
160            @Override
161            public boolean isNew() {
162                    return _ratingsEntry.isNew();
163            }
164    
165            @Override
166            public ExpandoBridge getExpandoBridge() {
167                    return _ratingsEntry.getExpandoBridge();
168            }
169    
170            @Override
171            public com.liferay.portal.kernel.model.CacheModel<RatingsEntry> toCacheModel() {
172                    return _ratingsEntry.toCacheModel();
173            }
174    
175            /**
176            * Returns the score of this ratings entry.
177            *
178            * @return the score of this ratings entry
179            */
180            @Override
181            public double getScore() {
182                    return _ratingsEntry.getScore();
183            }
184    
185            @Override
186            public int compareTo(RatingsEntry ratingsEntry) {
187                    return _ratingsEntry.compareTo(ratingsEntry);
188            }
189    
190            @Override
191            public int hashCode() {
192                    return _ratingsEntry.hashCode();
193            }
194    
195            @Override
196            public Serializable getPrimaryKeyObj() {
197                    return _ratingsEntry.getPrimaryKeyObj();
198            }
199    
200            @Override
201            public java.lang.Object clone() {
202                    return new RatingsEntryWrapper((RatingsEntry)_ratingsEntry.clone());
203            }
204    
205            /**
206            * Returns the fully qualified class name of this ratings entry.
207            *
208            * @return the fully qualified class name of this ratings entry
209            */
210            @Override
211            public java.lang.String getClassName() {
212                    return _ratingsEntry.getClassName();
213            }
214    
215            /**
216            * Returns the user name of this ratings entry.
217            *
218            * @return the user name of this ratings entry
219            */
220            @Override
221            public java.lang.String getUserName() {
222                    return _ratingsEntry.getUserName();
223            }
224    
225            /**
226            * Returns the user uuid of this ratings entry.
227            *
228            * @return the user uuid of this ratings entry
229            */
230            @Override
231            public java.lang.String getUserUuid() {
232                    return _ratingsEntry.getUserUuid();
233            }
234    
235            /**
236            * Returns the uuid of this ratings entry.
237            *
238            * @return the uuid of this ratings entry
239            */
240            @Override
241            public java.lang.String getUuid() {
242                    return _ratingsEntry.getUuid();
243            }
244    
245            @Override
246            public java.lang.String toString() {
247                    return _ratingsEntry.toString();
248            }
249    
250            @Override
251            public java.lang.String toXmlString() {
252                    return _ratingsEntry.toXmlString();
253            }
254    
255            /**
256            * Returns the create date of this ratings entry.
257            *
258            * @return the create date of this ratings entry
259            */
260            @Override
261            public Date getCreateDate() {
262                    return _ratingsEntry.getCreateDate();
263            }
264    
265            /**
266            * Returns the modified date of this ratings entry.
267            *
268            * @return the modified date of this ratings entry
269            */
270            @Override
271            public Date getModifiedDate() {
272                    return _ratingsEntry.getModifiedDate();
273            }
274    
275            /**
276            * Returns the class name ID of this ratings entry.
277            *
278            * @return the class name ID of this ratings entry
279            */
280            @Override
281            public long getClassNameId() {
282                    return _ratingsEntry.getClassNameId();
283            }
284    
285            /**
286            * Returns the class p k of this ratings entry.
287            *
288            * @return the class p k of this ratings entry
289            */
290            @Override
291            public long getClassPK() {
292                    return _ratingsEntry.getClassPK();
293            }
294    
295            /**
296            * Returns the company ID of this ratings entry.
297            *
298            * @return the company ID of this ratings entry
299            */
300            @Override
301            public long getCompanyId() {
302                    return _ratingsEntry.getCompanyId();
303            }
304    
305            /**
306            * Returns the entry ID of this ratings entry.
307            *
308            * @return the entry ID of this ratings entry
309            */
310            @Override
311            public long getEntryId() {
312                    return _ratingsEntry.getEntryId();
313            }
314    
315            /**
316            * Returns the primary key of this ratings entry.
317            *
318            * @return the primary key of this ratings entry
319            */
320            @Override
321            public long getPrimaryKey() {
322                    return _ratingsEntry.getPrimaryKey();
323            }
324    
325            /**
326            * Returns the user ID of this ratings entry.
327            *
328            * @return the user ID of this ratings entry
329            */
330            @Override
331            public long getUserId() {
332                    return _ratingsEntry.getUserId();
333            }
334    
335            @Override
336            public void persist() {
337                    _ratingsEntry.persist();
338            }
339    
340            @Override
341            public void setCachedModel(boolean cachedModel) {
342                    _ratingsEntry.setCachedModel(cachedModel);
343            }
344    
345            @Override
346            public void setClassName(java.lang.String className) {
347                    _ratingsEntry.setClassName(className);
348            }
349    
350            /**
351            * Sets the class name ID of this ratings entry.
352            *
353            * @param classNameId the class name ID of this ratings entry
354            */
355            @Override
356            public void setClassNameId(long classNameId) {
357                    _ratingsEntry.setClassNameId(classNameId);
358            }
359    
360            /**
361            * Sets the class p k of this ratings entry.
362            *
363            * @param classPK the class p k of this ratings entry
364            */
365            @Override
366            public void setClassPK(long classPK) {
367                    _ratingsEntry.setClassPK(classPK);
368            }
369    
370            /**
371            * Sets the company ID of this ratings entry.
372            *
373            * @param companyId the company ID of this ratings entry
374            */
375            @Override
376            public void setCompanyId(long companyId) {
377                    _ratingsEntry.setCompanyId(companyId);
378            }
379    
380            /**
381            * Sets the create date of this ratings entry.
382            *
383            * @param createDate the create date of this ratings entry
384            */
385            @Override
386            public void setCreateDate(Date createDate) {
387                    _ratingsEntry.setCreateDate(createDate);
388            }
389    
390            /**
391            * Sets the entry ID of this ratings entry.
392            *
393            * @param entryId the entry ID of this ratings entry
394            */
395            @Override
396            public void setEntryId(long entryId) {
397                    _ratingsEntry.setEntryId(entryId);
398            }
399    
400            @Override
401            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
402                    _ratingsEntry.setExpandoBridgeAttributes(expandoBridge);
403            }
404    
405            @Override
406            public void setExpandoBridgeAttributes(
407                    com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
408                    _ratingsEntry.setExpandoBridgeAttributes(baseModel);
409            }
410    
411            @Override
412            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
413                    _ratingsEntry.setExpandoBridgeAttributes(serviceContext);
414            }
415    
416            /**
417            * Sets the modified date of this ratings entry.
418            *
419            * @param modifiedDate the modified date of this ratings entry
420            */
421            @Override
422            public void setModifiedDate(Date modifiedDate) {
423                    _ratingsEntry.setModifiedDate(modifiedDate);
424            }
425    
426            @Override
427            public void setNew(boolean n) {
428                    _ratingsEntry.setNew(n);
429            }
430    
431            /**
432            * Sets the primary key of this ratings entry.
433            *
434            * @param primaryKey the primary key of this ratings entry
435            */
436            @Override
437            public void setPrimaryKey(long primaryKey) {
438                    _ratingsEntry.setPrimaryKey(primaryKey);
439            }
440    
441            @Override
442            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
443                    _ratingsEntry.setPrimaryKeyObj(primaryKeyObj);
444            }
445    
446            /**
447            * Sets the score of this ratings entry.
448            *
449            * @param score the score of this ratings entry
450            */
451            @Override
452            public void setScore(double score) {
453                    _ratingsEntry.setScore(score);
454            }
455    
456            /**
457            * Sets the user ID of this ratings entry.
458            *
459            * @param userId the user ID of this ratings entry
460            */
461            @Override
462            public void setUserId(long userId) {
463                    _ratingsEntry.setUserId(userId);
464            }
465    
466            /**
467            * Sets the user name of this ratings entry.
468            *
469            * @param userName the user name of this ratings entry
470            */
471            @Override
472            public void setUserName(java.lang.String userName) {
473                    _ratingsEntry.setUserName(userName);
474            }
475    
476            /**
477            * Sets the user uuid of this ratings entry.
478            *
479            * @param userUuid the user uuid of this ratings entry
480            */
481            @Override
482            public void setUserUuid(java.lang.String userUuid) {
483                    _ratingsEntry.setUserUuid(userUuid);
484            }
485    
486            /**
487            * Sets the uuid of this ratings entry.
488            *
489            * @param uuid the uuid of this ratings entry
490            */
491            @Override
492            public void setUuid(java.lang.String uuid) {
493                    _ratingsEntry.setUuid(uuid);
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 (Objects.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    }