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