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