001
014
015 package com.liferay.portlet.documentlibrary.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.sql.Blob;
021
022 import java.util.HashMap;
023 import java.util.Map;
024
025
034 public class DLContentWrapper implements DLContent, ModelWrapper<DLContent> {
035 public DLContentWrapper(DLContent dlContent) {
036 _dlContent = dlContent;
037 }
038
039 public Class<?> getModelClass() {
040 return DLContent.class;
041 }
042
043 public String getModelClassName() {
044 return DLContent.class.getName();
045 }
046
047 public Map<String, Object> getModelAttributes() {
048 Map<String, Object> attributes = new HashMap<String, Object>();
049
050 attributes.put("contentId", getContentId());
051 attributes.put("groupId", getGroupId());
052 attributes.put("companyId", getCompanyId());
053 attributes.put("repositoryId", getRepositoryId());
054 attributes.put("path", getPath());
055 attributes.put("version", getVersion());
056 attributes.put("data", getData());
057 attributes.put("size", getSize());
058
059 return attributes;
060 }
061
062 public void setModelAttributes(Map<String, Object> attributes) {
063 Long contentId = (Long)attributes.get("contentId");
064
065 if (contentId != null) {
066 setContentId(contentId);
067 }
068
069 Long groupId = (Long)attributes.get("groupId");
070
071 if (groupId != null) {
072 setGroupId(groupId);
073 }
074
075 Long companyId = (Long)attributes.get("companyId");
076
077 if (companyId != null) {
078 setCompanyId(companyId);
079 }
080
081 Long repositoryId = (Long)attributes.get("repositoryId");
082
083 if (repositoryId != null) {
084 setRepositoryId(repositoryId);
085 }
086
087 String path = (String)attributes.get("path");
088
089 if (path != null) {
090 setPath(path);
091 }
092
093 String version = (String)attributes.get("version");
094
095 if (version != null) {
096 setVersion(version);
097 }
098
099 Blob data = (Blob)attributes.get("data");
100
101 if (data != null) {
102 setData(data);
103 }
104
105 Long size = (Long)attributes.get("size");
106
107 if (size != null) {
108 setSize(size);
109 }
110 }
111
112
117 public long getPrimaryKey() {
118 return _dlContent.getPrimaryKey();
119 }
120
121
126 public void setPrimaryKey(long primaryKey) {
127 _dlContent.setPrimaryKey(primaryKey);
128 }
129
130
135 public long getContentId() {
136 return _dlContent.getContentId();
137 }
138
139
144 public void setContentId(long contentId) {
145 _dlContent.setContentId(contentId);
146 }
147
148
153 public long getGroupId() {
154 return _dlContent.getGroupId();
155 }
156
157
162 public void setGroupId(long groupId) {
163 _dlContent.setGroupId(groupId);
164 }
165
166
171 public long getCompanyId() {
172 return _dlContent.getCompanyId();
173 }
174
175
180 public void setCompanyId(long companyId) {
181 _dlContent.setCompanyId(companyId);
182 }
183
184
189 public long getRepositoryId() {
190 return _dlContent.getRepositoryId();
191 }
192
193
198 public void setRepositoryId(long repositoryId) {
199 _dlContent.setRepositoryId(repositoryId);
200 }
201
202
207 public java.lang.String getPath() {
208 return _dlContent.getPath();
209 }
210
211
216 public void setPath(java.lang.String path) {
217 _dlContent.setPath(path);
218 }
219
220
225 public java.lang.String getVersion() {
226 return _dlContent.getVersion();
227 }
228
229
234 public void setVersion(java.lang.String version) {
235 _dlContent.setVersion(version);
236 }
237
238
243 public java.sql.Blob getData() {
244 return _dlContent.getData();
245 }
246
247
252 public void setData(java.sql.Blob data) {
253 _dlContent.setData(data);
254 }
255
256
261 public long getSize() {
262 return _dlContent.getSize();
263 }
264
265
270 public void setSize(long size) {
271 _dlContent.setSize(size);
272 }
273
274 public boolean isNew() {
275 return _dlContent.isNew();
276 }
277
278 public void setNew(boolean n) {
279 _dlContent.setNew(n);
280 }
281
282 public boolean isCachedModel() {
283 return _dlContent.isCachedModel();
284 }
285
286 public void setCachedModel(boolean cachedModel) {
287 _dlContent.setCachedModel(cachedModel);
288 }
289
290 public boolean isEscapedModel() {
291 return _dlContent.isEscapedModel();
292 }
293
294 public java.io.Serializable getPrimaryKeyObj() {
295 return _dlContent.getPrimaryKeyObj();
296 }
297
298 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
299 _dlContent.setPrimaryKeyObj(primaryKeyObj);
300 }
301
302 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
303 return _dlContent.getExpandoBridge();
304 }
305
306 public void setExpandoBridgeAttributes(
307 com.liferay.portal.service.ServiceContext serviceContext) {
308 _dlContent.setExpandoBridgeAttributes(serviceContext);
309 }
310
311 @Override
312 public java.lang.Object clone() {
313 return new DLContentWrapper((DLContent)_dlContent.clone());
314 }
315
316 public int compareTo(
317 com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
318 return _dlContent.compareTo(dlContent);
319 }
320
321 @Override
322 public int hashCode() {
323 return _dlContent.hashCode();
324 }
325
326 public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLContent> toCacheModel() {
327 return _dlContent.toCacheModel();
328 }
329
330 public com.liferay.portlet.documentlibrary.model.DLContent toEscapedModel() {
331 return new DLContentWrapper(_dlContent.toEscapedModel());
332 }
333
334 public com.liferay.portlet.documentlibrary.model.DLContent toUnescapedModel() {
335 return new DLContentWrapper(_dlContent.toUnescapedModel());
336 }
337
338 @Override
339 public java.lang.String toString() {
340 return _dlContent.toString();
341 }
342
343 public java.lang.String toXmlString() {
344 return _dlContent.toXmlString();
345 }
346
347 public void persist()
348 throws com.liferay.portal.kernel.exception.SystemException {
349 _dlContent.persist();
350 }
351
352 @Override
353 public boolean equals(Object obj) {
354 if (this == obj) {
355 return true;
356 }
357
358 if (!(obj instanceof DLContentWrapper)) {
359 return false;
360 }
361
362 DLContentWrapper dlContentWrapper = (DLContentWrapper)obj;
363
364 if (Validator.equals(_dlContent, dlContentWrapper._dlContent)) {
365 return true;
366 }
367
368 return false;
369 }
370
371
374 public DLContent getWrappedDLContent() {
375 return _dlContent;
376 }
377
378 public DLContent getWrappedModel() {
379 return _dlContent;
380 }
381
382 public void resetOriginalValues() {
383 _dlContent.resetOriginalValues();
384 }
385
386 private DLContent _dlContent;
387 }