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