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            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            /**
113            * Returns the primary key of this document library content.
114            *
115            * @return the primary key of this document library content
116            */
117            public long getPrimaryKey() {
118                    return _dlContent.getPrimaryKey();
119            }
120    
121            /**
122            * Sets the primary key of this document library content.
123            *
124            * @param primaryKey the primary key of this document library content
125            */
126            public void setPrimaryKey(long primaryKey) {
127                    _dlContent.setPrimaryKey(primaryKey);
128            }
129    
130            /**
131            * Returns the content ID of this document library content.
132            *
133            * @return the content ID of this document library content
134            */
135            public long getContentId() {
136                    return _dlContent.getContentId();
137            }
138    
139            /**
140            * Sets the content ID of this document library content.
141            *
142            * @param contentId the content ID of this document library content
143            */
144            public void setContentId(long contentId) {
145                    _dlContent.setContentId(contentId);
146            }
147    
148            /**
149            * Returns the group ID of this document library content.
150            *
151            * @return the group ID of this document library content
152            */
153            public long getGroupId() {
154                    return _dlContent.getGroupId();
155            }
156    
157            /**
158            * Sets the group ID of this document library content.
159            *
160            * @param groupId the group ID of this document library content
161            */
162            public void setGroupId(long groupId) {
163                    _dlContent.setGroupId(groupId);
164            }
165    
166            /**
167            * Returns the company ID of this document library content.
168            *
169            * @return the company ID of this document library content
170            */
171            public long getCompanyId() {
172                    return _dlContent.getCompanyId();
173            }
174    
175            /**
176            * Sets the company ID of this document library content.
177            *
178            * @param companyId the company ID of this document library content
179            */
180            public void setCompanyId(long companyId) {
181                    _dlContent.setCompanyId(companyId);
182            }
183    
184            /**
185            * Returns the repository ID of this document library content.
186            *
187            * @return the repository ID of this document library content
188            */
189            public long getRepositoryId() {
190                    return _dlContent.getRepositoryId();
191            }
192    
193            /**
194            * Sets the repository ID of this document library content.
195            *
196            * @param repositoryId the repository ID of this document library content
197            */
198            public void setRepositoryId(long repositoryId) {
199                    _dlContent.setRepositoryId(repositoryId);
200            }
201    
202            /**
203            * Returns the path of this document library content.
204            *
205            * @return the path of this document library content
206            */
207            public java.lang.String getPath() {
208                    return _dlContent.getPath();
209            }
210    
211            /**
212            * Sets the path of this document library content.
213            *
214            * @param path the path of this document library content
215            */
216            public void setPath(java.lang.String path) {
217                    _dlContent.setPath(path);
218            }
219    
220            /**
221            * Returns the version of this document library content.
222            *
223            * @return the version of this document library content
224            */
225            public java.lang.String getVersion() {
226                    return _dlContent.getVersion();
227            }
228    
229            /**
230            * Sets the version of this document library content.
231            *
232            * @param version the version of this document library content
233            */
234            public void setVersion(java.lang.String version) {
235                    _dlContent.setVersion(version);
236            }
237    
238            /**
239            * Returns the data of this document library content.
240            *
241            * @return the data of this document library content
242            */
243            public java.sql.Blob getData() {
244                    return _dlContent.getData();
245            }
246    
247            /**
248            * Sets the data of this document library content.
249            *
250            * @param data the data of this document library content
251            */
252            public void setData(java.sql.Blob data) {
253                    _dlContent.setData(data);
254            }
255    
256            /**
257            * Returns the size of this document library content.
258            *
259            * @return the size of this document library content
260            */
261            public long getSize() {
262                    return _dlContent.getSize();
263            }
264    
265            /**
266            * Sets the size of this document library content.
267            *
268            * @param size the size of this document library content
269            */
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            /**
372             * @deprecated Renamed to {@link #getWrappedModel}
373             */
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    }