001    /**
002     * Copyright (c) 2000-present 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            @Override
120            public java.lang.Object clone() {
121                    return new DLContentWrapper((DLContent)_dlContent.clone());
122            }
123    
124            @Override
125            public int compareTo(
126                    com.liferay.portlet.documentlibrary.model.DLContent dlContent) {
127                    return _dlContent.compareTo(dlContent);
128            }
129    
130            /**
131            * Returns the company ID of this document library content.
132            *
133            * @return the company ID of this document library content
134            */
135            @Override
136            public long getCompanyId() {
137                    return _dlContent.getCompanyId();
138            }
139    
140            /**
141            * Returns the content ID of this document library content.
142            *
143            * @return the content ID of this document library content
144            */
145            @Override
146            public long getContentId() {
147                    return _dlContent.getContentId();
148            }
149    
150            /**
151            * Returns the data of this document library content.
152            *
153            * @return the data of this document library content
154            */
155            @Override
156            public Blob getData() {
157                    return _dlContent.getData();
158            }
159    
160            @Override
161            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
162                    return _dlContent.getExpandoBridge();
163            }
164    
165            /**
166            * Returns the group ID of this document library content.
167            *
168            * @return the group ID of this document library content
169            */
170            @Override
171            public long getGroupId() {
172                    return _dlContent.getGroupId();
173            }
174    
175            /**
176            * Returns the path of this document library content.
177            *
178            * @return the path of this document library content
179            */
180            @Override
181            public java.lang.String getPath() {
182                    return _dlContent.getPath();
183            }
184    
185            /**
186            * Returns the primary key of this document library content.
187            *
188            * @return the primary key of this document library content
189            */
190            @Override
191            public long getPrimaryKey() {
192                    return _dlContent.getPrimaryKey();
193            }
194    
195            @Override
196            public java.io.Serializable getPrimaryKeyObj() {
197                    return _dlContent.getPrimaryKeyObj();
198            }
199    
200            /**
201            * Returns the repository ID of this document library content.
202            *
203            * @return the repository ID of this document library content
204            */
205            @Override
206            public long getRepositoryId() {
207                    return _dlContent.getRepositoryId();
208            }
209    
210            /**
211            * Returns the size of this document library content.
212            *
213            * @return the size of this document library content
214            */
215            @Override
216            public long getSize() {
217                    return _dlContent.getSize();
218            }
219    
220            /**
221            * Returns the version of this document library content.
222            *
223            * @return the version of this document library content
224            */
225            @Override
226            public java.lang.String getVersion() {
227                    return _dlContent.getVersion();
228            }
229    
230            @Override
231            public int hashCode() {
232                    return _dlContent.hashCode();
233            }
234    
235            @Override
236            public boolean isCachedModel() {
237                    return _dlContent.isCachedModel();
238            }
239    
240            @Override
241            public boolean isEscapedModel() {
242                    return _dlContent.isEscapedModel();
243            }
244    
245            @Override
246            public boolean isNew() {
247                    return _dlContent.isNew();
248            }
249    
250            @Override
251            public void persist() {
252                    _dlContent.persist();
253            }
254    
255            @Override
256            public void setCachedModel(boolean cachedModel) {
257                    _dlContent.setCachedModel(cachedModel);
258            }
259    
260            /**
261            * Sets the company ID of this document library content.
262            *
263            * @param companyId the company ID of this document library content
264            */
265            @Override
266            public void setCompanyId(long companyId) {
267                    _dlContent.setCompanyId(companyId);
268            }
269    
270            /**
271            * Sets the content ID of this document library content.
272            *
273            * @param contentId the content ID of this document library content
274            */
275            @Override
276            public void setContentId(long contentId) {
277                    _dlContent.setContentId(contentId);
278            }
279    
280            /**
281            * Sets the data of this document library content.
282            *
283            * @param data the data of this document library content
284            */
285            @Override
286            public void setData(Blob data) {
287                    _dlContent.setData(data);
288            }
289    
290            @Override
291            public void setExpandoBridgeAttributes(
292                    com.liferay.portal.model.BaseModel<?> baseModel) {
293                    _dlContent.setExpandoBridgeAttributes(baseModel);
294            }
295    
296            @Override
297            public void setExpandoBridgeAttributes(
298                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
299                    _dlContent.setExpandoBridgeAttributes(expandoBridge);
300            }
301    
302            @Override
303            public void setExpandoBridgeAttributes(
304                    com.liferay.portal.service.ServiceContext serviceContext) {
305                    _dlContent.setExpandoBridgeAttributes(serviceContext);
306            }
307    
308            /**
309            * Sets the group ID of this document library content.
310            *
311            * @param groupId the group ID of this document library content
312            */
313            @Override
314            public void setGroupId(long groupId) {
315                    _dlContent.setGroupId(groupId);
316            }
317    
318            @Override
319            public void setNew(boolean n) {
320                    _dlContent.setNew(n);
321            }
322    
323            /**
324            * Sets the path of this document library content.
325            *
326            * @param path the path of this document library content
327            */
328            @Override
329            public void setPath(java.lang.String path) {
330                    _dlContent.setPath(path);
331            }
332    
333            /**
334            * Sets the primary key of this document library content.
335            *
336            * @param primaryKey the primary key of this document library content
337            */
338            @Override
339            public void setPrimaryKey(long primaryKey) {
340                    _dlContent.setPrimaryKey(primaryKey);
341            }
342    
343            @Override
344            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
345                    _dlContent.setPrimaryKeyObj(primaryKeyObj);
346            }
347    
348            /**
349            * Sets the repository ID of this document library content.
350            *
351            * @param repositoryId the repository ID of this document library content
352            */
353            @Override
354            public void setRepositoryId(long repositoryId) {
355                    _dlContent.setRepositoryId(repositoryId);
356            }
357    
358            /**
359            * Sets the size of this document library content.
360            *
361            * @param size the size of this document library content
362            */
363            @Override
364            public void setSize(long size) {
365                    _dlContent.setSize(size);
366            }
367    
368            /**
369            * Sets the version of this document library content.
370            *
371            * @param version the version of this document library content
372            */
373            @Override
374            public void setVersion(java.lang.String version) {
375                    _dlContent.setVersion(version);
376            }
377    
378            @Override
379            public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLContent> toCacheModel() {
380                    return _dlContent.toCacheModel();
381            }
382    
383            @Override
384            public com.liferay.portlet.documentlibrary.model.DLContent toEscapedModel() {
385                    return new DLContentWrapper(_dlContent.toEscapedModel());
386            }
387    
388            @Override
389            public java.lang.String toString() {
390                    return _dlContent.toString();
391            }
392    
393            @Override
394            public com.liferay.portlet.documentlibrary.model.DLContent toUnescapedModel() {
395                    return new DLContentWrapper(_dlContent.toUnescapedModel());
396            }
397    
398            @Override
399            public java.lang.String toXmlString() {
400                    return _dlContent.toXmlString();
401            }
402    
403            @Override
404            public boolean equals(Object obj) {
405                    if (this == obj) {
406                            return true;
407                    }
408    
409                    if (!(obj instanceof DLContentWrapper)) {
410                            return false;
411                    }
412    
413                    DLContentWrapper dlContentWrapper = (DLContentWrapper)obj;
414    
415                    if (Validator.equals(_dlContent, dlContentWrapper._dlContent)) {
416                            return true;
417                    }
418    
419                    return false;
420            }
421    
422            @Override
423            public DLContent getWrappedModel() {
424                    return _dlContent;
425            }
426    
427            @Override
428            public boolean isEntityCacheEnabled() {
429                    return _dlContent.isEntityCacheEnabled();
430            }
431    
432            @Override
433            public boolean isFinderCacheEnabled() {
434                    return _dlContent.isFinderCacheEnabled();
435            }
436    
437            @Override
438            public void resetOriginalValues() {
439                    _dlContent.resetOriginalValues();
440            }
441    
442            private final DLContent _dlContent;
443    }