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