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 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    /**
028     * <p>
029     * This class is a wrapper for {@link DLContent}.
030     * </p>
031     *
032     * @author Brian Wing Shun Chan
033     * @see DLContent
034     * @generated
035     */
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            /**
120            * Returns the primary key of this document library content.
121            *
122            * @return the primary key of this document library content
123            */
124            @Override
125            public long getPrimaryKey() {
126                    return _dlContent.getPrimaryKey();
127            }
128    
129            /**
130            * Sets the primary key of this document library content.
131            *
132            * @param primaryKey the primary key of this document library content
133            */
134            @Override
135            public void setPrimaryKey(long primaryKey) {
136                    _dlContent.setPrimaryKey(primaryKey);
137            }
138    
139            /**
140            * Returns the content ID of this document library content.
141            *
142            * @return the content ID of this document library content
143            */
144            @Override
145            public long getContentId() {
146                    return _dlContent.getContentId();
147            }
148    
149            /**
150            * Sets the content ID of this document library content.
151            *
152            * @param contentId the content ID of this document library content
153            */
154            @Override
155            public void setContentId(long contentId) {
156                    _dlContent.setContentId(contentId);
157            }
158    
159            /**
160            * Returns the group ID of this document library content.
161            *
162            * @return the group ID of this document library content
163            */
164            @Override
165            public long getGroupId() {
166                    return _dlContent.getGroupId();
167            }
168    
169            /**
170            * Sets the group ID of this document library content.
171            *
172            * @param groupId the group ID of this document library content
173            */
174            @Override
175            public void setGroupId(long groupId) {
176                    _dlContent.setGroupId(groupId);
177            }
178    
179            /**
180            * Returns the company ID of this document library content.
181            *
182            * @return the company ID of this document library content
183            */
184            @Override
185            public long getCompanyId() {
186                    return _dlContent.getCompanyId();
187            }
188    
189            /**
190            * Sets the company ID of this document library content.
191            *
192            * @param companyId the company ID of this document library content
193            */
194            @Override
195            public void setCompanyId(long companyId) {
196                    _dlContent.setCompanyId(companyId);
197            }
198    
199            /**
200            * Returns the repository ID of this document library content.
201            *
202            * @return the repository ID of this document library content
203            */
204            @Override
205            public long getRepositoryId() {
206                    return _dlContent.getRepositoryId();
207            }
208    
209            /**
210            * Sets the repository ID of this document library content.
211            *
212            * @param repositoryId the repository ID of this document library content
213            */
214            @Override
215            public void setRepositoryId(long repositoryId) {
216                    _dlContent.setRepositoryId(repositoryId);
217            }
218    
219            /**
220            * Returns the path of this document library content.
221            *
222            * @return the path of this document library content
223            */
224            @Override
225            public java.lang.String getPath() {
226                    return _dlContent.getPath();
227            }
228    
229            /**
230            * Sets the path of this document library content.
231            *
232            * @param path the path of this document library content
233            */
234            @Override
235            public void setPath(java.lang.String path) {
236                    _dlContent.setPath(path);
237            }
238    
239            /**
240            * Returns the version of this document library content.
241            *
242            * @return the version of this document library content
243            */
244            @Override
245            public java.lang.String getVersion() {
246                    return _dlContent.getVersion();
247            }
248    
249            /**
250            * Sets the version of this document library content.
251            *
252            * @param version the version of this document library content
253            */
254            @Override
255            public void setVersion(java.lang.String version) {
256                    _dlContent.setVersion(version);
257            }
258    
259            /**
260            * Returns the data of this document library content.
261            *
262            * @return the data of this document library content
263            */
264            @Override
265            public java.sql.Blob getData() {
266                    return _dlContent.getData();
267            }
268    
269            /**
270            * Sets the data of this document library content.
271            *
272            * @param data the data of this document library content
273            */
274            @Override
275            public void setData(java.sql.Blob data) {
276                    _dlContent.setData(data);
277            }
278    
279            /**
280            * Returns the size of this document library content.
281            *
282            * @return the size of this document library content
283            */
284            @Override
285            public long getSize() {
286                    return _dlContent.getSize();
287            }
288    
289            /**
290            * Sets the size of this document library content.
291            *
292            * @param size the size of this document library content
293            */
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            /**
424             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
425             */
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    }