001    /**
002     * Copyright (c) 2000-2013 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.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    /**
026     * <p>
027     * This class is a wrapper for {@link DLContent}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLContent
032     * @generated
033     */
034    public class DLContentWrapper implements DLContent, ModelWrapper<DLContent> {
035            public DLContentWrapper(DLContent dlContent) {
036                    _dlContent = dlContent;
037            }
038    
039            @Override
040            public Class<?> getModelClass() {
041                    return DLContent.class;
042            }
043    
044            @Override
045            public String getModelClassName() {
046                    return DLContent.class.getName();
047            }
048    
049            @Override
050            public Map<String, Object> getModelAttributes() {
051                    Map<String, Object> attributes = new HashMap<String, Object>();
052    
053                    attributes.put("contentId", getContentId());
054                    attributes.put("groupId", getGroupId());
055                    attributes.put("companyId", getCompanyId());
056                    attributes.put("repositoryId", getRepositoryId());
057                    attributes.put("path", getPath());
058                    attributes.put("version", getVersion());
059                    attributes.put("data", getData());
060                    attributes.put("size", getSize());
061    
062                    return attributes;
063            }
064    
065            @Override
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    Long contentId = (Long)attributes.get("contentId");
068    
069                    if (contentId != null) {
070                            setContentId(contentId);
071                    }
072    
073                    Long groupId = (Long)attributes.get("groupId");
074    
075                    if (groupId != null) {
076                            setGroupId(groupId);
077                    }
078    
079                    Long companyId = (Long)attributes.get("companyId");
080    
081                    if (companyId != null) {
082                            setCompanyId(companyId);
083                    }
084    
085                    Long repositoryId = (Long)attributes.get("repositoryId");
086    
087                    if (repositoryId != null) {
088                            setRepositoryId(repositoryId);
089                    }
090    
091                    String path = (String)attributes.get("path");
092    
093                    if (path != null) {
094                            setPath(path);
095                    }
096    
097                    String version = (String)attributes.get("version");
098    
099                    if (version != null) {
100                            setVersion(version);
101                    }
102    
103                    Blob data = (Blob)attributes.get("data");
104    
105                    if (data != null) {
106                            setData(data);
107                    }
108    
109                    Long size = (Long)attributes.get("size");
110    
111                    if (size != null) {
112                            setSize(size);
113                    }
114            }
115    
116            /**
117            * Returns the primary key of this document library content.
118            *
119            * @return the primary key of this document library content
120            */
121            @Override
122            public long getPrimaryKey() {
123                    return _dlContent.getPrimaryKey();
124            }
125    
126            /**
127            * Sets the primary key of this document library content.
128            *
129            * @param primaryKey the primary key of this document library content
130            */
131            @Override
132            public void setPrimaryKey(long primaryKey) {
133                    _dlContent.setPrimaryKey(primaryKey);
134            }
135    
136            /**
137            * Returns the content ID of this document library content.
138            *
139            * @return the content ID of this document library content
140            */
141            @Override
142            public long getContentId() {
143                    return _dlContent.getContentId();
144            }
145    
146            /**
147            * Sets the content ID of this document library content.
148            *
149            * @param contentId the content ID of this document library content
150            */
151            @Override
152            public void setContentId(long contentId) {
153                    _dlContent.setContentId(contentId);
154            }
155    
156            /**
157            * Returns the group ID of this document library content.
158            *
159            * @return the group ID of this document library content
160            */
161            @Override
162            public long getGroupId() {
163                    return _dlContent.getGroupId();
164            }
165    
166            /**
167            * Sets the group ID of this document library content.
168            *
169            * @param groupId the group ID of this document library content
170            */
171            @Override
172            public void setGroupId(long groupId) {
173                    _dlContent.setGroupId(groupId);
174            }
175    
176            /**
177            * Returns the company ID of this document library content.
178            *
179            * @return the company ID of this document library content
180            */
181            @Override
182            public long getCompanyId() {
183                    return _dlContent.getCompanyId();
184            }
185    
186            /**
187            * Sets the company ID of this document library content.
188            *
189            * @param companyId the company ID of this document library content
190            */
191            @Override
192            public void setCompanyId(long companyId) {
193                    _dlContent.setCompanyId(companyId);
194            }
195    
196            /**
197            * Returns the repository ID of this document library content.
198            *
199            * @return the repository ID of this document library content
200            */
201            @Override
202            public long getRepositoryId() {
203                    return _dlContent.getRepositoryId();
204            }
205    
206            /**
207            * Sets the repository ID of this document library content.
208            *
209            * @param repositoryId the repository ID of this document library content
210            */
211            @Override
212            public void setRepositoryId(long repositoryId) {
213                    _dlContent.setRepositoryId(repositoryId);
214            }
215    
216            /**
217            * Returns the path of this document library content.
218            *
219            * @return the path of this document library content
220            */
221            @Override
222            public java.lang.String getPath() {
223                    return _dlContent.getPath();
224            }
225    
226            /**
227            * Sets the path of this document library content.
228            *
229            * @param path the path of this document library content
230            */
231            @Override
232            public void setPath(java.lang.String path) {
233                    _dlContent.setPath(path);
234            }
235    
236            /**
237            * Returns the version of this document library content.
238            *
239            * @return the version of this document library content
240            */
241            @Override
242            public java.lang.String getVersion() {
243                    return _dlContent.getVersion();
244            }
245    
246            /**
247            * Sets the version of this document library content.
248            *
249            * @param version the version of this document library content
250            */
251            @Override
252            public void setVersion(java.lang.String version) {
253                    _dlContent.setVersion(version);
254            }
255    
256            /**
257            * Returns the data of this document library content.
258            *
259            * @return the data of this document library content
260            */
261            @Override
262            public java.sql.Blob getData() {
263                    return _dlContent.getData();
264            }
265    
266            /**
267            * Sets the data of this document library content.
268            *
269            * @param data the data of this document library content
270            */
271            @Override
272            public void setData(java.sql.Blob data) {
273                    _dlContent.setData(data);
274            }
275    
276            /**
277            * Returns the size of this document library content.
278            *
279            * @return the size of this document library content
280            */
281            @Override
282            public long getSize() {
283                    return _dlContent.getSize();
284            }
285    
286            /**
287            * Sets the size of this document library content.
288            *
289            * @param size the size of this document library content
290            */
291            @Override
292            public void setSize(long size) {
293                    _dlContent.setSize(size);
294            }
295    
296            @Override
297            public boolean isNew() {
298                    return _dlContent.isNew();
299            }
300    
301            @Override
302            public void setNew(boolean n) {
303                    _dlContent.setNew(n);
304            }
305    
306            @Override
307            public boolean isCachedModel() {
308                    return _dlContent.isCachedModel();
309            }
310    
311            @Override
312            public void setCachedModel(boolean cachedModel) {
313                    _dlContent.setCachedModel(cachedModel);
314            }
315    
316            @Override
317            public boolean isEscapedModel() {
318                    return _dlContent.isEscapedModel();
319            }
320    
321            @Override
322            public java.io.Serializable getPrimaryKeyObj() {
323                    return _dlContent.getPrimaryKeyObj();
324            }
325    
326            @Override
327            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
328                    _dlContent.setPrimaryKeyObj(primaryKeyObj);
329            }
330    
331            @Override
332            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
333                    return _dlContent.getExpandoBridge();
334            }
335    
336            @Override
337            public void setExpandoBridgeAttributes(
338                    com.liferay.portal.model.BaseModel<?> baseModel) {
339                    _dlContent.setExpandoBridgeAttributes(baseModel);
340            }
341    
342            @Override
343            public void setExpandoBridgeAttributes(
344                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
345                    _dlContent.setExpandoBridgeAttributes(expandoBridge);
346            }
347    
348            @Override
349            public void setExpandoBridgeAttributes(
350                    com.liferay.portal.service.ServiceContext serviceContext) {
351                    _dlContent.setExpandoBridgeAttributes(serviceContext);
352            }
353    
354            @Override
355            public java.lang.Object clone() {
356                    return new DLContentWrapper((DLContent)_dlContent.clone());
357            }
358    
359            @Override
360            public int compareTo(
361                    com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
362                    return _dlContent.compareTo(dlContent);
363            }
364    
365            @Override
366            public int hashCode() {
367                    return _dlContent.hashCode();
368            }
369    
370            @Override
371            public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLContent> toCacheModel() {
372                    return _dlContent.toCacheModel();
373            }
374    
375            @Override
376            public com.liferay.portlet.documentlibrary.model.DLContent toEscapedModel() {
377                    return new DLContentWrapper(_dlContent.toEscapedModel());
378            }
379    
380            @Override
381            public com.liferay.portlet.documentlibrary.model.DLContent toUnescapedModel() {
382                    return new DLContentWrapper(_dlContent.toUnescapedModel());
383            }
384    
385            @Override
386            public java.lang.String toString() {
387                    return _dlContent.toString();
388            }
389    
390            @Override
391            public java.lang.String toXmlString() {
392                    return _dlContent.toXmlString();
393            }
394    
395            @Override
396            public void persist()
397                    throws com.liferay.portal.kernel.exception.SystemException {
398                    _dlContent.persist();
399            }
400    
401            @Override
402            public boolean equals(Object obj) {
403                    if (this == obj) {
404                            return true;
405                    }
406    
407                    if (!(obj instanceof DLContentWrapper)) {
408                            return false;
409                    }
410    
411                    DLContentWrapper dlContentWrapper = (DLContentWrapper)obj;
412    
413                    if (Validator.equals(_dlContent, dlContentWrapper._dlContent)) {
414                            return true;
415                    }
416    
417                    return false;
418            }
419    
420            /**
421             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
422             */
423            public DLContent getWrappedDLContent() {
424                    return _dlContent;
425            }
426    
427            @Override
428            public DLContent getWrappedModel() {
429                    return _dlContent;
430            }
431    
432            @Override
433            public void resetOriginalValues() {
434                    _dlContent.resetOriginalValues();
435            }
436    
437            private DLContent _dlContent;
438    }