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.social.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    
025    import java.io.Serializable;
026    
027    import java.util.HashMap;
028    import java.util.Map;
029    
030    /**
031     * <p>
032     * This class is a wrapper for {@link SocialActivityAchievement}.
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see SocialActivityAchievement
037     * @generated
038     */
039    @ProviderType
040    public class SocialActivityAchievementWrapper
041            implements SocialActivityAchievement,
042                    ModelWrapper<SocialActivityAchievement> {
043            public SocialActivityAchievementWrapper(
044                    SocialActivityAchievement socialActivityAchievement) {
045                    _socialActivityAchievement = socialActivityAchievement;
046            }
047    
048            @Override
049            public Class<?> getModelClass() {
050                    return SocialActivityAchievement.class;
051            }
052    
053            @Override
054            public String getModelClassName() {
055                    return SocialActivityAchievement.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("activityAchievementId", getActivityAchievementId());
063                    attributes.put("groupId", getGroupId());
064                    attributes.put("companyId", getCompanyId());
065                    attributes.put("userId", getUserId());
066                    attributes.put("createDate", getCreateDate());
067                    attributes.put("name", getName());
068                    attributes.put("firstInGroup", getFirstInGroup());
069    
070                    return attributes;
071            }
072    
073            @Override
074            public void setModelAttributes(Map<String, Object> attributes) {
075                    Long activityAchievementId = (Long)attributes.get(
076                                    "activityAchievementId");
077    
078                    if (activityAchievementId != null) {
079                            setActivityAchievementId(activityAchievementId);
080                    }
081    
082                    Long groupId = (Long)attributes.get("groupId");
083    
084                    if (groupId != null) {
085                            setGroupId(groupId);
086                    }
087    
088                    Long companyId = (Long)attributes.get("companyId");
089    
090                    if (companyId != null) {
091                            setCompanyId(companyId);
092                    }
093    
094                    Long userId = (Long)attributes.get("userId");
095    
096                    if (userId != null) {
097                            setUserId(userId);
098                    }
099    
100                    Long createDate = (Long)attributes.get("createDate");
101    
102                    if (createDate != null) {
103                            setCreateDate(createDate);
104                    }
105    
106                    String name = (String)attributes.get("name");
107    
108                    if (name != null) {
109                            setName(name);
110                    }
111    
112                    Boolean firstInGroup = (Boolean)attributes.get("firstInGroup");
113    
114                    if (firstInGroup != null) {
115                            setFirstInGroup(firstInGroup);
116                    }
117            }
118    
119            @Override
120            public java.lang.Object clone() {
121                    return new SocialActivityAchievementWrapper((SocialActivityAchievement)_socialActivityAchievement.clone());
122            }
123    
124            @Override
125            public int compareTo(
126                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement) {
127                    return _socialActivityAchievement.compareTo(socialActivityAchievement);
128            }
129    
130            /**
131            * Returns the activity achievement ID of this social activity achievement.
132            *
133            * @return the activity achievement ID of this social activity achievement
134            */
135            @Override
136            public long getActivityAchievementId() {
137                    return _socialActivityAchievement.getActivityAchievementId();
138            }
139    
140            /**
141            * Returns the company ID of this social activity achievement.
142            *
143            * @return the company ID of this social activity achievement
144            */
145            @Override
146            public long getCompanyId() {
147                    return _socialActivityAchievement.getCompanyId();
148            }
149    
150            /**
151            * Returns the create date of this social activity achievement.
152            *
153            * @return the create date of this social activity achievement
154            */
155            @Override
156            public long getCreateDate() {
157                    return _socialActivityAchievement.getCreateDate();
158            }
159    
160            @Override
161            public ExpandoBridge getExpandoBridge() {
162                    return _socialActivityAchievement.getExpandoBridge();
163            }
164    
165            /**
166            * Returns the first in group of this social activity achievement.
167            *
168            * @return the first in group of this social activity achievement
169            */
170            @Override
171            public boolean getFirstInGroup() {
172                    return _socialActivityAchievement.getFirstInGroup();
173            }
174    
175            /**
176            * Returns the group ID of this social activity achievement.
177            *
178            * @return the group ID of this social activity achievement
179            */
180            @Override
181            public long getGroupId() {
182                    return _socialActivityAchievement.getGroupId();
183            }
184    
185            /**
186            * Returns the name of this social activity achievement.
187            *
188            * @return the name of this social activity achievement
189            */
190            @Override
191            public java.lang.String getName() {
192                    return _socialActivityAchievement.getName();
193            }
194    
195            /**
196            * Returns the primary key of this social activity achievement.
197            *
198            * @return the primary key of this social activity achievement
199            */
200            @Override
201            public long getPrimaryKey() {
202                    return _socialActivityAchievement.getPrimaryKey();
203            }
204    
205            @Override
206            public Serializable getPrimaryKeyObj() {
207                    return _socialActivityAchievement.getPrimaryKeyObj();
208            }
209    
210            /**
211            * Returns the user ID of this social activity achievement.
212            *
213            * @return the user ID of this social activity achievement
214            */
215            @Override
216            public long getUserId() {
217                    return _socialActivityAchievement.getUserId();
218            }
219    
220            /**
221            * Returns the user uuid of this social activity achievement.
222            *
223            * @return the user uuid of this social activity achievement
224            */
225            @Override
226            public java.lang.String getUserUuid() {
227                    return _socialActivityAchievement.getUserUuid();
228            }
229    
230            @Override
231            public int hashCode() {
232                    return _socialActivityAchievement.hashCode();
233            }
234    
235            @Override
236            public boolean isCachedModel() {
237                    return _socialActivityAchievement.isCachedModel();
238            }
239    
240            @Override
241            public boolean isEscapedModel() {
242                    return _socialActivityAchievement.isEscapedModel();
243            }
244    
245            /**
246            * Returns <code>true</code> if this social activity achievement is first in group.
247            *
248            * @return <code>true</code> if this social activity achievement is first in group; <code>false</code> otherwise
249            */
250            @Override
251            public boolean isFirstInGroup() {
252                    return _socialActivityAchievement.isFirstInGroup();
253            }
254    
255            @Override
256            public boolean isNew() {
257                    return _socialActivityAchievement.isNew();
258            }
259    
260            @Override
261            public void persist() {
262                    _socialActivityAchievement.persist();
263            }
264    
265            /**
266            * Sets the activity achievement ID of this social activity achievement.
267            *
268            * @param activityAchievementId the activity achievement ID of this social activity achievement
269            */
270            @Override
271            public void setActivityAchievementId(long activityAchievementId) {
272                    _socialActivityAchievement.setActivityAchievementId(activityAchievementId);
273            }
274    
275            @Override
276            public void setCachedModel(boolean cachedModel) {
277                    _socialActivityAchievement.setCachedModel(cachedModel);
278            }
279    
280            /**
281            * Sets the company ID of this social activity achievement.
282            *
283            * @param companyId the company ID of this social activity achievement
284            */
285            @Override
286            public void setCompanyId(long companyId) {
287                    _socialActivityAchievement.setCompanyId(companyId);
288            }
289    
290            /**
291            * Sets the create date of this social activity achievement.
292            *
293            * @param createDate the create date of this social activity achievement
294            */
295            @Override
296            public void setCreateDate(long createDate) {
297                    _socialActivityAchievement.setCreateDate(createDate);
298            }
299    
300            @Override
301            public void setExpandoBridgeAttributes(
302                    com.liferay.portal.model.BaseModel<?> baseModel) {
303                    _socialActivityAchievement.setExpandoBridgeAttributes(baseModel);
304            }
305    
306            @Override
307            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
308                    _socialActivityAchievement.setExpandoBridgeAttributes(expandoBridge);
309            }
310    
311            @Override
312            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
313                    _socialActivityAchievement.setExpandoBridgeAttributes(serviceContext);
314            }
315    
316            /**
317            * Sets whether this social activity achievement is first in group.
318            *
319            * @param firstInGroup the first in group of this social activity achievement
320            */
321            @Override
322            public void setFirstInGroup(boolean firstInGroup) {
323                    _socialActivityAchievement.setFirstInGroup(firstInGroup);
324            }
325    
326            /**
327            * Sets the group ID of this social activity achievement.
328            *
329            * @param groupId the group ID of this social activity achievement
330            */
331            @Override
332            public void setGroupId(long groupId) {
333                    _socialActivityAchievement.setGroupId(groupId);
334            }
335    
336            /**
337            * Sets the name of this social activity achievement.
338            *
339            * @param name the name of this social activity achievement
340            */
341            @Override
342            public void setName(java.lang.String name) {
343                    _socialActivityAchievement.setName(name);
344            }
345    
346            @Override
347            public void setNew(boolean n) {
348                    _socialActivityAchievement.setNew(n);
349            }
350    
351            /**
352            * Sets the primary key of this social activity achievement.
353            *
354            * @param primaryKey the primary key of this social activity achievement
355            */
356            @Override
357            public void setPrimaryKey(long primaryKey) {
358                    _socialActivityAchievement.setPrimaryKey(primaryKey);
359            }
360    
361            @Override
362            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
363                    _socialActivityAchievement.setPrimaryKeyObj(primaryKeyObj);
364            }
365    
366            /**
367            * Sets the user ID of this social activity achievement.
368            *
369            * @param userId the user ID of this social activity achievement
370            */
371            @Override
372            public void setUserId(long userId) {
373                    _socialActivityAchievement.setUserId(userId);
374            }
375    
376            /**
377            * Sets the user uuid of this social activity achievement.
378            *
379            * @param userUuid the user uuid of this social activity achievement
380            */
381            @Override
382            public void setUserUuid(java.lang.String userUuid) {
383                    _socialActivityAchievement.setUserUuid(userUuid);
384            }
385    
386            @Override
387            public com.liferay.portal.model.CacheModel<com.liferay.portlet.social.model.SocialActivityAchievement> toCacheModel() {
388                    return _socialActivityAchievement.toCacheModel();
389            }
390    
391            @Override
392            public com.liferay.portlet.social.model.SocialActivityAchievement toEscapedModel() {
393                    return new SocialActivityAchievementWrapper(_socialActivityAchievement.toEscapedModel());
394            }
395    
396            @Override
397            public java.lang.String toString() {
398                    return _socialActivityAchievement.toString();
399            }
400    
401            @Override
402            public com.liferay.portlet.social.model.SocialActivityAchievement toUnescapedModel() {
403                    return new SocialActivityAchievementWrapper(_socialActivityAchievement.toUnescapedModel());
404            }
405    
406            @Override
407            public java.lang.String toXmlString() {
408                    return _socialActivityAchievement.toXmlString();
409            }
410    
411            @Override
412            public boolean equals(Object obj) {
413                    if (this == obj) {
414                            return true;
415                    }
416    
417                    if (!(obj instanceof SocialActivityAchievementWrapper)) {
418                            return false;
419                    }
420    
421                    SocialActivityAchievementWrapper socialActivityAchievementWrapper = (SocialActivityAchievementWrapper)obj;
422    
423                    if (Validator.equals(_socialActivityAchievement,
424                                            socialActivityAchievementWrapper._socialActivityAchievement)) {
425                            return true;
426                    }
427    
428                    return false;
429            }
430    
431            @Override
432            public SocialActivityAchievement getWrappedModel() {
433                    return _socialActivityAchievement;
434            }
435    
436            @Override
437            public boolean isEntityCacheEnabled() {
438                    return _socialActivityAchievement.isEntityCacheEnabled();
439            }
440    
441            @Override
442            public boolean isFinderCacheEnabled() {
443                    return _socialActivityAchievement.isFinderCacheEnabled();
444            }
445    
446            @Override
447            public void resetOriginalValues() {
448                    _socialActivityAchievement.resetOriginalValues();
449            }
450    
451            private final SocialActivityAchievement _socialActivityAchievement;
452    }