001    /**
002     * Copyright (c) 2000-2013 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            /**
112            * Returns the primary key of this social relation.
113            *
114            * @return the primary key of this social relation
115            */
116            @Override
117            public long getPrimaryKey() {
118                    return _socialRelation.getPrimaryKey();
119            }
120    
121            /**
122            * Sets the primary key of this social relation.
123            *
124            * @param primaryKey the primary key of this social relation
125            */
126            @Override
127            public void setPrimaryKey(long primaryKey) {
128                    _socialRelation.setPrimaryKey(primaryKey);
129            }
130    
131            /**
132            * Returns the uuid of this social relation.
133            *
134            * @return the uuid of this social relation
135            */
136            @Override
137            public java.lang.String getUuid() {
138                    return _socialRelation.getUuid();
139            }
140    
141            /**
142            * Sets the uuid of this social relation.
143            *
144            * @param uuid the uuid of this social relation
145            */
146            @Override
147            public void setUuid(java.lang.String uuid) {
148                    _socialRelation.setUuid(uuid);
149            }
150    
151            /**
152            * Returns the relation ID of this social relation.
153            *
154            * @return the relation ID of this social relation
155            */
156            @Override
157            public long getRelationId() {
158                    return _socialRelation.getRelationId();
159            }
160    
161            /**
162            * Sets the relation ID of this social relation.
163            *
164            * @param relationId the relation ID of this social relation
165            */
166            @Override
167            public void setRelationId(long relationId) {
168                    _socialRelation.setRelationId(relationId);
169            }
170    
171            /**
172            * Returns the company ID of this social relation.
173            *
174            * @return the company ID of this social relation
175            */
176            @Override
177            public long getCompanyId() {
178                    return _socialRelation.getCompanyId();
179            }
180    
181            /**
182            * Sets the company ID of this social relation.
183            *
184            * @param companyId the company ID of this social relation
185            */
186            @Override
187            public void setCompanyId(long companyId) {
188                    _socialRelation.setCompanyId(companyId);
189            }
190    
191            /**
192            * Returns the create date of this social relation.
193            *
194            * @return the create date of this social relation
195            */
196            @Override
197            public long getCreateDate() {
198                    return _socialRelation.getCreateDate();
199            }
200    
201            /**
202            * Sets the create date of this social relation.
203            *
204            * @param createDate the create date of this social relation
205            */
206            @Override
207            public void setCreateDate(long createDate) {
208                    _socialRelation.setCreateDate(createDate);
209            }
210    
211            /**
212            * Returns the user id1 of this social relation.
213            *
214            * @return the user id1 of this social relation
215            */
216            @Override
217            public long getUserId1() {
218                    return _socialRelation.getUserId1();
219            }
220    
221            /**
222            * Sets the user id1 of this social relation.
223            *
224            * @param userId1 the user id1 of this social relation
225            */
226            @Override
227            public void setUserId1(long userId1) {
228                    _socialRelation.setUserId1(userId1);
229            }
230    
231            /**
232            * Returns the user id2 of this social relation.
233            *
234            * @return the user id2 of this social relation
235            */
236            @Override
237            public long getUserId2() {
238                    return _socialRelation.getUserId2();
239            }
240    
241            /**
242            * Sets the user id2 of this social relation.
243            *
244            * @param userId2 the user id2 of this social relation
245            */
246            @Override
247            public void setUserId2(long userId2) {
248                    _socialRelation.setUserId2(userId2);
249            }
250    
251            /**
252            * Returns the type of this social relation.
253            *
254            * @return the type of this social relation
255            */
256            @Override
257            public int getType() {
258                    return _socialRelation.getType();
259            }
260    
261            /**
262            * Sets the type of this social relation.
263            *
264            * @param type the type of this social relation
265            */
266            @Override
267            public void setType(int type) {
268                    _socialRelation.setType(type);
269            }
270    
271            @Override
272            public boolean isNew() {
273                    return _socialRelation.isNew();
274            }
275    
276            @Override
277            public void setNew(boolean n) {
278                    _socialRelation.setNew(n);
279            }
280    
281            @Override
282            public boolean isCachedModel() {
283                    return _socialRelation.isCachedModel();
284            }
285    
286            @Override
287            public void setCachedModel(boolean cachedModel) {
288                    _socialRelation.setCachedModel(cachedModel);
289            }
290    
291            @Override
292            public boolean isEscapedModel() {
293                    return _socialRelation.isEscapedModel();
294            }
295    
296            @Override
297            public java.io.Serializable getPrimaryKeyObj() {
298                    return _socialRelation.getPrimaryKeyObj();
299            }
300    
301            @Override
302            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
303                    _socialRelation.setPrimaryKeyObj(primaryKeyObj);
304            }
305    
306            @Override
307            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
308                    return _socialRelation.getExpandoBridge();
309            }
310    
311            @Override
312            public void setExpandoBridgeAttributes(
313                    com.liferay.portal.model.BaseModel<?> baseModel) {
314                    _socialRelation.setExpandoBridgeAttributes(baseModel);
315            }
316    
317            @Override
318            public void setExpandoBridgeAttributes(
319                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
320                    _socialRelation.setExpandoBridgeAttributes(expandoBridge);
321            }
322    
323            @Override
324            public void setExpandoBridgeAttributes(
325                    com.liferay.portal.service.ServiceContext serviceContext) {
326                    _socialRelation.setExpandoBridgeAttributes(serviceContext);
327            }
328    
329            @Override
330            public java.lang.Object clone() {
331                    return new SocialRelationWrapper((SocialRelation)_socialRelation.clone());
332            }
333    
334            @Override
335            public int compareTo(
336                    com.liferay.portlet.social.model.SocialRelation socialRelation) {
337                    return _socialRelation.compareTo(socialRelation);
338            }
339    
340            @Override
341            public int hashCode() {
342                    return _socialRelation.hashCode();
343            }
344    
345            @Override
346            public com.liferay.portal.model.CacheModel<com.liferay.portlet.social.model.SocialRelation> toCacheModel() {
347                    return _socialRelation.toCacheModel();
348            }
349    
350            @Override
351            public com.liferay.portlet.social.model.SocialRelation toEscapedModel() {
352                    return new SocialRelationWrapper(_socialRelation.toEscapedModel());
353            }
354    
355            @Override
356            public com.liferay.portlet.social.model.SocialRelation toUnescapedModel() {
357                    return new SocialRelationWrapper(_socialRelation.toUnescapedModel());
358            }
359    
360            @Override
361            public java.lang.String toString() {
362                    return _socialRelation.toString();
363            }
364    
365            @Override
366            public java.lang.String toXmlString() {
367                    return _socialRelation.toXmlString();
368            }
369    
370            @Override
371            public void persist()
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    _socialRelation.persist();
374            }
375    
376            @Override
377            public boolean equals(Object obj) {
378                    if (this == obj) {
379                            return true;
380                    }
381    
382                    if (!(obj instanceof SocialRelationWrapper)) {
383                            return false;
384                    }
385    
386                    SocialRelationWrapper socialRelationWrapper = (SocialRelationWrapper)obj;
387    
388                    if (Validator.equals(_socialRelation,
389                                            socialRelationWrapper._socialRelation)) {
390                            return true;
391                    }
392    
393                    return false;
394            }
395    
396            /**
397             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
398             */
399            public SocialRelation getWrappedSocialRelation() {
400                    return _socialRelation;
401            }
402    
403            @Override
404            public SocialRelation getWrappedModel() {
405                    return _socialRelation;
406            }
407    
408            @Override
409            public void resetOriginalValues() {
410                    _socialRelation.resetOriginalValues();
411            }
412    
413            private SocialRelation _socialRelation;
414    }