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