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