001
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
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
113 @Override
114 public long getPrimaryKey() {
115 return _socialRelation.getPrimaryKey();
116 }
117
118
123 @Override
124 public void setPrimaryKey(long primaryKey) {
125 _socialRelation.setPrimaryKey(primaryKey);
126 }
127
128
133 @Override
134 public java.lang.String getUuid() {
135 return _socialRelation.getUuid();
136 }
137
138
143 @Override
144 public void setUuid(java.lang.String uuid) {
145 _socialRelation.setUuid(uuid);
146 }
147
148
153 @Override
154 public long getRelationId() {
155 return _socialRelation.getRelationId();
156 }
157
158
163 @Override
164 public void setRelationId(long relationId) {
165 _socialRelation.setRelationId(relationId);
166 }
167
168
173 @Override
174 public long getCompanyId() {
175 return _socialRelation.getCompanyId();
176 }
177
178
183 @Override
184 public void setCompanyId(long companyId) {
185 _socialRelation.setCompanyId(companyId);
186 }
187
188
193 @Override
194 public long getCreateDate() {
195 return _socialRelation.getCreateDate();
196 }
197
198
203 @Override
204 public void setCreateDate(long createDate) {
205 _socialRelation.setCreateDate(createDate);
206 }
207
208
213 @Override
214 public long getUserId1() {
215 return _socialRelation.getUserId1();
216 }
217
218
223 @Override
224 public void setUserId1(long userId1) {
225 _socialRelation.setUserId1(userId1);
226 }
227
228
233 @Override
234 public long getUserId2() {
235 return _socialRelation.getUserId2();
236 }
237
238
243 @Override
244 public void setUserId2(long userId2) {
245 _socialRelation.setUserId2(userId2);
246 }
247
248
253 @Override
254 public int getType() {
255 return _socialRelation.getType();
256 }
257
258
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
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 }