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