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