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.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link DLFileEntryMetadata}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       DLFileEntryMetadata
030     * @generated
031     */
032    public class DLFileEntryMetadataWrapper implements DLFileEntryMetadata,
033            ModelWrapper<DLFileEntryMetadata> {
034            public DLFileEntryMetadataWrapper(DLFileEntryMetadata dlFileEntryMetadata) {
035                    _dlFileEntryMetadata = dlFileEntryMetadata;
036            }
037    
038            public Class<?> getModelClass() {
039                    return DLFileEntryMetadata.class;
040            }
041    
042            public String getModelClassName() {
043                    return DLFileEntryMetadata.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("fileEntryMetadataId", getFileEntryMetadataId());
051                    attributes.put("DDMStorageId", getDDMStorageId());
052                    attributes.put("DDMStructureId", getDDMStructureId());
053                    attributes.put("fileEntryTypeId", getFileEntryTypeId());
054                    attributes.put("fileEntryId", getFileEntryId());
055                    attributes.put("fileVersionId", getFileVersionId());
056    
057                    return attributes;
058            }
059    
060            public void setModelAttributes(Map<String, Object> attributes) {
061                    String uuid = (String)attributes.get("uuid");
062    
063                    if (uuid != null) {
064                            setUuid(uuid);
065                    }
066    
067                    Long fileEntryMetadataId = (Long)attributes.get("fileEntryMetadataId");
068    
069                    if (fileEntryMetadataId != null) {
070                            setFileEntryMetadataId(fileEntryMetadataId);
071                    }
072    
073                    Long DDMStorageId = (Long)attributes.get("DDMStorageId");
074    
075                    if (DDMStorageId != null) {
076                            setDDMStorageId(DDMStorageId);
077                    }
078    
079                    Long DDMStructureId = (Long)attributes.get("DDMStructureId");
080    
081                    if (DDMStructureId != null) {
082                            setDDMStructureId(DDMStructureId);
083                    }
084    
085                    Long fileEntryTypeId = (Long)attributes.get("fileEntryTypeId");
086    
087                    if (fileEntryTypeId != null) {
088                            setFileEntryTypeId(fileEntryTypeId);
089                    }
090    
091                    Long fileEntryId = (Long)attributes.get("fileEntryId");
092    
093                    if (fileEntryId != null) {
094                            setFileEntryId(fileEntryId);
095                    }
096    
097                    Long fileVersionId = (Long)attributes.get("fileVersionId");
098    
099                    if (fileVersionId != null) {
100                            setFileVersionId(fileVersionId);
101                    }
102            }
103    
104            /**
105            * Returns the primary key of this document library file entry metadata.
106            *
107            * @return the primary key of this document library file entry metadata
108            */
109            public long getPrimaryKey() {
110                    return _dlFileEntryMetadata.getPrimaryKey();
111            }
112    
113            /**
114            * Sets the primary key of this document library file entry metadata.
115            *
116            * @param primaryKey the primary key of this document library file entry metadata
117            */
118            public void setPrimaryKey(long primaryKey) {
119                    _dlFileEntryMetadata.setPrimaryKey(primaryKey);
120            }
121    
122            /**
123            * Returns the uuid of this document library file entry metadata.
124            *
125            * @return the uuid of this document library file entry metadata
126            */
127            public java.lang.String getUuid() {
128                    return _dlFileEntryMetadata.getUuid();
129            }
130    
131            /**
132            * Sets the uuid of this document library file entry metadata.
133            *
134            * @param uuid the uuid of this document library file entry metadata
135            */
136            public void setUuid(java.lang.String uuid) {
137                    _dlFileEntryMetadata.setUuid(uuid);
138            }
139    
140            /**
141            * Returns the file entry metadata ID of this document library file entry metadata.
142            *
143            * @return the file entry metadata ID of this document library file entry metadata
144            */
145            public long getFileEntryMetadataId() {
146                    return _dlFileEntryMetadata.getFileEntryMetadataId();
147            }
148    
149            /**
150            * Sets the file entry metadata ID of this document library file entry metadata.
151            *
152            * @param fileEntryMetadataId the file entry metadata ID of this document library file entry metadata
153            */
154            public void setFileEntryMetadataId(long fileEntryMetadataId) {
155                    _dlFileEntryMetadata.setFileEntryMetadataId(fileEntryMetadataId);
156            }
157    
158            /**
159            * Returns the d d m storage ID of this document library file entry metadata.
160            *
161            * @return the d d m storage ID of this document library file entry metadata
162            */
163            public long getDDMStorageId() {
164                    return _dlFileEntryMetadata.getDDMStorageId();
165            }
166    
167            /**
168            * Sets the d d m storage ID of this document library file entry metadata.
169            *
170            * @param DDMStorageId the d d m storage ID of this document library file entry metadata
171            */
172            public void setDDMStorageId(long DDMStorageId) {
173                    _dlFileEntryMetadata.setDDMStorageId(DDMStorageId);
174            }
175    
176            /**
177            * Returns the d d m structure ID of this document library file entry metadata.
178            *
179            * @return the d d m structure ID of this document library file entry metadata
180            */
181            public long getDDMStructureId() {
182                    return _dlFileEntryMetadata.getDDMStructureId();
183            }
184    
185            /**
186            * Sets the d d m structure ID of this document library file entry metadata.
187            *
188            * @param DDMStructureId the d d m structure ID of this document library file entry metadata
189            */
190            public void setDDMStructureId(long DDMStructureId) {
191                    _dlFileEntryMetadata.setDDMStructureId(DDMStructureId);
192            }
193    
194            /**
195            * Returns the file entry type ID of this document library file entry metadata.
196            *
197            * @return the file entry type ID of this document library file entry metadata
198            */
199            public long getFileEntryTypeId() {
200                    return _dlFileEntryMetadata.getFileEntryTypeId();
201            }
202    
203            /**
204            * Sets the file entry type ID of this document library file entry metadata.
205            *
206            * @param fileEntryTypeId the file entry type ID of this document library file entry metadata
207            */
208            public void setFileEntryTypeId(long fileEntryTypeId) {
209                    _dlFileEntryMetadata.setFileEntryTypeId(fileEntryTypeId);
210            }
211    
212            /**
213            * Returns the file entry ID of this document library file entry metadata.
214            *
215            * @return the file entry ID of this document library file entry metadata
216            */
217            public long getFileEntryId() {
218                    return _dlFileEntryMetadata.getFileEntryId();
219            }
220    
221            /**
222            * Sets the file entry ID of this document library file entry metadata.
223            *
224            * @param fileEntryId the file entry ID of this document library file entry metadata
225            */
226            public void setFileEntryId(long fileEntryId) {
227                    _dlFileEntryMetadata.setFileEntryId(fileEntryId);
228            }
229    
230            /**
231            * Returns the file version ID of this document library file entry metadata.
232            *
233            * @return the file version ID of this document library file entry metadata
234            */
235            public long getFileVersionId() {
236                    return _dlFileEntryMetadata.getFileVersionId();
237            }
238    
239            /**
240            * Sets the file version ID of this document library file entry metadata.
241            *
242            * @param fileVersionId the file version ID of this document library file entry metadata
243            */
244            public void setFileVersionId(long fileVersionId) {
245                    _dlFileEntryMetadata.setFileVersionId(fileVersionId);
246            }
247    
248            public boolean isNew() {
249                    return _dlFileEntryMetadata.isNew();
250            }
251    
252            public void setNew(boolean n) {
253                    _dlFileEntryMetadata.setNew(n);
254            }
255    
256            public boolean isCachedModel() {
257                    return _dlFileEntryMetadata.isCachedModel();
258            }
259    
260            public void setCachedModel(boolean cachedModel) {
261                    _dlFileEntryMetadata.setCachedModel(cachedModel);
262            }
263    
264            public boolean isEscapedModel() {
265                    return _dlFileEntryMetadata.isEscapedModel();
266            }
267    
268            public java.io.Serializable getPrimaryKeyObj() {
269                    return _dlFileEntryMetadata.getPrimaryKeyObj();
270            }
271    
272            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
273                    _dlFileEntryMetadata.setPrimaryKeyObj(primaryKeyObj);
274            }
275    
276            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
277                    return _dlFileEntryMetadata.getExpandoBridge();
278            }
279    
280            public void setExpandoBridgeAttributes(
281                    com.liferay.portal.service.ServiceContext serviceContext) {
282                    _dlFileEntryMetadata.setExpandoBridgeAttributes(serviceContext);
283            }
284    
285            @Override
286            public java.lang.Object clone() {
287                    return new DLFileEntryMetadataWrapper((DLFileEntryMetadata)_dlFileEntryMetadata.clone());
288            }
289    
290            public int compareTo(
291                    com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata dlFileEntryMetadata) {
292                    return _dlFileEntryMetadata.compareTo(dlFileEntryMetadata);
293            }
294    
295            @Override
296            public int hashCode() {
297                    return _dlFileEntryMetadata.hashCode();
298            }
299    
300            public com.liferay.portal.model.CacheModel<com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata> toCacheModel() {
301                    return _dlFileEntryMetadata.toCacheModel();
302            }
303    
304            public com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata toEscapedModel() {
305                    return new DLFileEntryMetadataWrapper(_dlFileEntryMetadata.toEscapedModel());
306            }
307    
308            public com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata toUnescapedModel() {
309                    return new DLFileEntryMetadataWrapper(_dlFileEntryMetadata.toUnescapedModel());
310            }
311    
312            @Override
313            public java.lang.String toString() {
314                    return _dlFileEntryMetadata.toString();
315            }
316    
317            public java.lang.String toXmlString() {
318                    return _dlFileEntryMetadata.toXmlString();
319            }
320    
321            public void persist()
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    _dlFileEntryMetadata.persist();
324            }
325    
326            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getDDMStructure()
327                    throws com.liferay.portal.kernel.exception.PortalException,
328                            com.liferay.portal.kernel.exception.SystemException {
329                    return _dlFileEntryMetadata.getDDMStructure();
330            }
331    
332            public com.liferay.portlet.documentlibrary.model.DLFileEntryType getFileEntryType()
333                    throws com.liferay.portal.kernel.exception.PortalException,
334                            com.liferay.portal.kernel.exception.SystemException {
335                    return _dlFileEntryMetadata.getFileEntryType();
336            }
337    
338            public com.liferay.portlet.documentlibrary.model.DLFileVersion getFileVersion()
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException {
341                    return _dlFileEntryMetadata.getFileVersion();
342            }
343    
344            @Override
345            public boolean equals(Object obj) {
346                    if (this == obj) {
347                            return true;
348                    }
349    
350                    if (!(obj instanceof DLFileEntryMetadataWrapper)) {
351                            return false;
352                    }
353    
354                    DLFileEntryMetadataWrapper dlFileEntryMetadataWrapper = (DLFileEntryMetadataWrapper)obj;
355    
356                    if (Validator.equals(_dlFileEntryMetadata,
357                                            dlFileEntryMetadataWrapper._dlFileEntryMetadata)) {
358                            return true;
359                    }
360    
361                    return false;
362            }
363    
364            /**
365             * @deprecated Renamed to {@link #getWrappedModel}
366             */
367            public DLFileEntryMetadata getWrappedDLFileEntryMetadata() {
368                    return _dlFileEntryMetadata;
369            }
370    
371            public DLFileEntryMetadata getWrappedModel() {
372                    return _dlFileEntryMetadata;
373            }
374    
375            public void resetOriginalValues() {
376                    _dlFileEntryMetadata.resetOriginalValues();
377            }
378    
379            private DLFileEntryMetadata _dlFileEntryMetadata;
380    }