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