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