001
014
015 package com.liferay.portlet.social.model;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.util.Validator;
020 import com.liferay.portal.model.ModelWrapper;
021 import com.liferay.portal.service.ServiceContext;
022
023 import com.liferay.portlet.expando.model.ExpandoBridge;
024
025 import java.io.Serializable;
026
027 import java.util.HashMap;
028 import java.util.Map;
029
030
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.portlet.social.model.SocialRelation socialRelation) {
124 return _socialRelation.compareTo(socialRelation);
125 }
126
127
132 @Override
133 public long getCompanyId() {
134 return _socialRelation.getCompanyId();
135 }
136
137
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
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
172 @Override
173 public long getRelationId() {
174 return _socialRelation.getRelationId();
175 }
176
177
182 @Override
183 public int getType() {
184 return _socialRelation.getType();
185 }
186
187
192 @Override
193 public long getUserId1() {
194 return _socialRelation.getUserId1();
195 }
196
197
202 @Override
203 public long getUserId2() {
204 return _socialRelation.getUserId2();
205 }
206
207
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
252 @Override
253 public void setCompanyId(long companyId) {
254 _socialRelation.setCompanyId(companyId);
255 }
256
257
262 @Override
263 public void setCreateDate(long createDate) {
264 _socialRelation.setCreateDate(createDate);
265 }
266
267 @Override
268 public void setExpandoBridgeAttributes(
269 com.liferay.portal.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
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
308 @Override
309 public void setRelationId(long relationId) {
310 _socialRelation.setRelationId(relationId);
311 }
312
313
318 @Override
319 public void setType(int type) {
320 _socialRelation.setType(type);
321 }
322
323
328 @Override
329 public void setUserId1(long userId1) {
330 _socialRelation.setUserId1(userId1);
331 }
332
333
338 @Override
339 public void setUserId2(long userId2) {
340 _socialRelation.setUserId2(userId2);
341 }
342
343
348 @Override
349 public void setUuid(java.lang.String uuid) {
350 _socialRelation.setUuid(uuid);
351 }
352
353 @Override
354 public com.liferay.portal.model.CacheModel<com.liferay.portlet.social.model.SocialRelation> toCacheModel() {
355 return _socialRelation.toCacheModel();
356 }
357
358 @Override
359 public com.liferay.portlet.social.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.portlet.social.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 }