001
014
015 package com.liferay.portlet.documentlibrary.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
022 import java.sql.Blob;
023
024 import java.util.HashMap;
025 import java.util.Map;
026
027
036 @ProviderType
037 public class DLContentWrapper implements DLContent, ModelWrapper<DLContent> {
038 public DLContentWrapper(DLContent dlContent) {
039 _dlContent = dlContent;
040 }
041
042 @Override
043 public Class<?> getModelClass() {
044 return DLContent.class;
045 }
046
047 @Override
048 public String getModelClassName() {
049 return DLContent.class.getName();
050 }
051
052 @Override
053 public Map<String, Object> getModelAttributes() {
054 Map<String, Object> attributes = new HashMap<String, Object>();
055
056 attributes.put("contentId", getContentId());
057 attributes.put("groupId", getGroupId());
058 attributes.put("companyId", getCompanyId());
059 attributes.put("repositoryId", getRepositoryId());
060 attributes.put("path", getPath());
061 attributes.put("version", getVersion());
062 attributes.put("data", getData());
063 attributes.put("size", getSize());
064
065 return attributes;
066 }
067
068 @Override
069 public void setModelAttributes(Map<String, Object> attributes) {
070 Long contentId = (Long)attributes.get("contentId");
071
072 if (contentId != null) {
073 setContentId(contentId);
074 }
075
076 Long groupId = (Long)attributes.get("groupId");
077
078 if (groupId != null) {
079 setGroupId(groupId);
080 }
081
082 Long companyId = (Long)attributes.get("companyId");
083
084 if (companyId != null) {
085 setCompanyId(companyId);
086 }
087
088 Long repositoryId = (Long)attributes.get("repositoryId");
089
090 if (repositoryId != null) {
091 setRepositoryId(repositoryId);
092 }
093
094 String path = (String)attributes.get("path");
095
096 if (path != null) {
097 setPath(path);
098 }
099
100 String version = (String)attributes.get("version");
101
102 if (version != null) {
103 setVersion(version);
104 }
105
106 Blob data = (Blob)attributes.get("data");
107
108 if (data != null) {
109 setData(data);
110 }
111
112 Long size = (Long)attributes.get("size");
113
114 if (size != null) {
115 setSize(size);
116 }
117 }
118
119
124 @Override
125 public long getPrimaryKey() {
126 return _dlContent.getPrimaryKey();
127 }
128
129
134 @Override
135 public void setPrimaryKey(long primaryKey) {
136 _dlContent.setPrimaryKey(primaryKey);
137 }
138
139
144 @Override
145 public long getContentId() {
146 return _dlContent.getContentId();
147 }
148
149
154 @Override
155 public void setContentId(long contentId) {
156 _dlContent.setContentId(contentId);
157 }
158
159
164 @Override
165 public long getGroupId() {
166 return _dlContent.getGroupId();
167 }
168
169
174 @Override
175 public void setGroupId(long groupId) {
176 _dlContent.setGroupId(groupId);
177 }
178
179
184 @Override
185 public long getCompanyId() {
186 return _dlContent.getCompanyId();
187 }
188
189
194 @Override
195 public void setCompanyId(long companyId) {
196 _dlContent.setCompanyId(companyId);
197 }
198
199
204 @Override
205 public long getRepositoryId() {
206 return _dlContent.getRepositoryId();
207 }
208
209
214 @Override
215 public void setRepositoryId(long repositoryId) {
216 _dlContent.setRepositoryId(repositoryId);
217 }
218
219
224 @Override
225 public java.lang.String getPath() {
226 return _dlContent.getPath();
227 }
228
229
234 @Override
235 public void setPath(java.lang.String path) {
236 _dlContent.setPath(path);
237 }
238
239
244 @Override
245 public java.lang.String getVersion() {
246 return _dlContent.getVersion();
247 }
248
249
254 @Override
255 public void setVersion(java.lang.String version) {
256 _dlContent.setVersion(version);
257 }
258
259
264 @Override
265 public java.sql.Blob getData() {
266 return _dlContent.getData();
267 }
268
269
274 @Override
275 public void setData(java.sql.Blob data) {
276 _dlContent.setData(data);
277 }
278
279
284 @Override
285 public long getSize() {
286 return _dlContent.getSize();
287 }
288
289
294 @Override
295 public void setSize(long size) {
296 _dlContent.setSize(size);
297 }
298
299 @Override
300 public boolean isNew() {
301 return _dlContent.isNew();
302 }
303
304 @Override
305 public void setNew(boolean n) {
306 _dlContent.setNew(n);
307 }
308
309 @Override
310 public boolean isCachedModel() {
311 return _dlContent.isCachedModel();
312 }
313
314 @Override
315 public void setCachedModel(boolean cachedModel) {
316 _dlContent.setCachedModel(cachedModel);
317 }
318
319 @Override
320 public boolean isEscapedModel() {
321 return _dlContent.isEscapedModel();
322 }
323
324 @Override
325 public java.io.Serializable getPrimaryKeyObj() {
326 return _dlContent.getPrimaryKeyObj();
327 }
328
329 @Override
330 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
331 _dlContent.setPrimaryKeyObj(primaryKeyObj);
332 }
333
334 @Override
335 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
336 return _dlContent.getExpandoBridge();
337 }
338
339 @Override
340 public void setExpandoBridgeAttributes(
341 com.liferay.portal.model.BaseModel<?> baseModel) {
342 _dlContent.setExpandoBridgeAttributes(baseModel);
343 }
344
345 @Override
346 public void setExpandoBridgeAttributes(
347 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
348 _dlContent.setExpandoBridgeAttributes(expandoBridge);
349 }
350
351 @Override
352 public void setExpandoBridgeAttributes(
353 com.liferay.portal.service.ServiceContext serviceContext) {
354 _dlContent.setExpandoBridgeAttributes(serviceContext);
355 }
356
357 @Override
358 public java.lang.Object clone() {
359 return new DLContentWrapper((DLContent)_dlContent.clone());
360 }
361
362 @Override
363 public int compareTo(
364 com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
365 return _dlContent.compareTo(dlContent);
366 }
367
368 @Override
369 public int hashCode() {
370 return _dlContent.hashCode();
371 }
372
373 @Override
374 public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLContent> toCacheModel() {
375 return _dlContent.toCacheModel();
376 }
377
378 @Override
379 public com.liferay.portlet.documentlibrary.model.DLContent toEscapedModel() {
380 return new DLContentWrapper(_dlContent.toEscapedModel());
381 }
382
383 @Override
384 public com.liferay.portlet.documentlibrary.model.DLContent toUnescapedModel() {
385 return new DLContentWrapper(_dlContent.toUnescapedModel());
386 }
387
388 @Override
389 public java.lang.String toString() {
390 return _dlContent.toString();
391 }
392
393 @Override
394 public java.lang.String toXmlString() {
395 return _dlContent.toXmlString();
396 }
397
398 @Override
399 public void persist()
400 throws com.liferay.portal.kernel.exception.SystemException {
401 _dlContent.persist();
402 }
403
404 @Override
405 public boolean equals(Object obj) {
406 if (this == obj) {
407 return true;
408 }
409
410 if (!(obj instanceof DLContentWrapper)) {
411 return false;
412 }
413
414 DLContentWrapper dlContentWrapper = (DLContentWrapper)obj;
415
416 if (Validator.equals(_dlContent, dlContentWrapper._dlContent)) {
417 return true;
418 }
419
420 return false;
421 }
422
423
426 public DLContent getWrappedDLContent() {
427 return _dlContent;
428 }
429
430 @Override
431 public DLContent getWrappedModel() {
432 return _dlContent;
433 }
434
435 @Override
436 public void resetOriginalValues() {
437 _dlContent.resetOriginalValues();
438 }
439
440 private DLContent _dlContent;
441 }