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