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