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