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