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.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link TrashEntry}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see TrashEntry
031     * @generated
032     */
033    public class TrashEntryWrapper implements TrashEntry, ModelWrapper<TrashEntry> {
034            public TrashEntryWrapper(TrashEntry trashEntry) {
035                    _trashEntry = trashEntry;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return TrashEntry.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return TrashEntry.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("entryId", getEntryId());
053                    attributes.put("groupId", getGroupId());
054                    attributes.put("companyId", getCompanyId());
055                    attributes.put("userId", getUserId());
056                    attributes.put("userName", getUserName());
057                    attributes.put("createDate", getCreateDate());
058                    attributes.put("classNameId", getClassNameId());
059                    attributes.put("classPK", getClassPK());
060                    attributes.put("systemEventSetKey", getSystemEventSetKey());
061                    attributes.put("typeSettings", getTypeSettings());
062                    attributes.put("status", getStatus());
063    
064                    return attributes;
065            }
066    
067            @Override
068            public void setModelAttributes(Map<String, Object> attributes) {
069                    Long entryId = (Long)attributes.get("entryId");
070    
071                    if (entryId != null) {
072                            setEntryId(entryId);
073                    }
074    
075                    Long groupId = (Long)attributes.get("groupId");
076    
077                    if (groupId != null) {
078                            setGroupId(groupId);
079                    }
080    
081                    Long companyId = (Long)attributes.get("companyId");
082    
083                    if (companyId != null) {
084                            setCompanyId(companyId);
085                    }
086    
087                    Long userId = (Long)attributes.get("userId");
088    
089                    if (userId != null) {
090                            setUserId(userId);
091                    }
092    
093                    String userName = (String)attributes.get("userName");
094    
095                    if (userName != null) {
096                            setUserName(userName);
097                    }
098    
099                    Date createDate = (Date)attributes.get("createDate");
100    
101                    if (createDate != null) {
102                            setCreateDate(createDate);
103                    }
104    
105                    Long classNameId = (Long)attributes.get("classNameId");
106    
107                    if (classNameId != null) {
108                            setClassNameId(classNameId);
109                    }
110    
111                    Long classPK = (Long)attributes.get("classPK");
112    
113                    if (classPK != null) {
114                            setClassPK(classPK);
115                    }
116    
117                    Long systemEventSetKey = (Long)attributes.get("systemEventSetKey");
118    
119                    if (systemEventSetKey != null) {
120                            setSystemEventSetKey(systemEventSetKey);
121                    }
122    
123                    String typeSettings = (String)attributes.get("typeSettings");
124    
125                    if (typeSettings != null) {
126                            setTypeSettings(typeSettings);
127                    }
128    
129                    Integer status = (Integer)attributes.get("status");
130    
131                    if (status != null) {
132                            setStatus(status);
133                    }
134            }
135    
136            /**
137            * Returns the primary key of this trash entry.
138            *
139            * @return the primary key of this trash entry
140            */
141            @Override
142            public long getPrimaryKey() {
143                    return _trashEntry.getPrimaryKey();
144            }
145    
146            /**
147            * Sets the primary key of this trash entry.
148            *
149            * @param primaryKey the primary key of this trash entry
150            */
151            @Override
152            public void setPrimaryKey(long primaryKey) {
153                    _trashEntry.setPrimaryKey(primaryKey);
154            }
155    
156            /**
157            * Returns the entry ID of this trash entry.
158            *
159            * @return the entry ID of this trash entry
160            */
161            @Override
162            public long getEntryId() {
163                    return _trashEntry.getEntryId();
164            }
165    
166            /**
167            * Sets the entry ID of this trash entry.
168            *
169            * @param entryId the entry ID of this trash entry
170            */
171            @Override
172            public void setEntryId(long entryId) {
173                    _trashEntry.setEntryId(entryId);
174            }
175    
176            /**
177            * Returns the group ID of this trash entry.
178            *
179            * @return the group ID of this trash entry
180            */
181            @Override
182            public long getGroupId() {
183                    return _trashEntry.getGroupId();
184            }
185    
186            /**
187            * Sets the group ID of this trash entry.
188            *
189            * @param groupId the group ID of this trash entry
190            */
191            @Override
192            public void setGroupId(long groupId) {
193                    _trashEntry.setGroupId(groupId);
194            }
195    
196            /**
197            * Returns the company ID of this trash entry.
198            *
199            * @return the company ID of this trash entry
200            */
201            @Override
202            public long getCompanyId() {
203                    return _trashEntry.getCompanyId();
204            }
205    
206            /**
207            * Sets the company ID of this trash entry.
208            *
209            * @param companyId the company ID of this trash entry
210            */
211            @Override
212            public void setCompanyId(long companyId) {
213                    _trashEntry.setCompanyId(companyId);
214            }
215    
216            /**
217            * Returns the user ID of this trash entry.
218            *
219            * @return the user ID of this trash entry
220            */
221            @Override
222            public long getUserId() {
223                    return _trashEntry.getUserId();
224            }
225    
226            /**
227            * Sets the user ID of this trash entry.
228            *
229            * @param userId the user ID of this trash entry
230            */
231            @Override
232            public void setUserId(long userId) {
233                    _trashEntry.setUserId(userId);
234            }
235    
236            /**
237            * Returns the user uuid of this trash entry.
238            *
239            * @return the user uuid of this trash entry
240            * @throws SystemException if a system exception occurred
241            */
242            @Override
243            public java.lang.String getUserUuid()
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return _trashEntry.getUserUuid();
246            }
247    
248            /**
249            * Sets the user uuid of this trash entry.
250            *
251            * @param userUuid the user uuid of this trash entry
252            */
253            @Override
254            public void setUserUuid(java.lang.String userUuid) {
255                    _trashEntry.setUserUuid(userUuid);
256            }
257    
258            /**
259            * Returns the user name of this trash entry.
260            *
261            * @return the user name of this trash entry
262            */
263            @Override
264            public java.lang.String getUserName() {
265                    return _trashEntry.getUserName();
266            }
267    
268            /**
269            * Sets the user name of this trash entry.
270            *
271            * @param userName the user name of this trash entry
272            */
273            @Override
274            public void setUserName(java.lang.String userName) {
275                    _trashEntry.setUserName(userName);
276            }
277    
278            /**
279            * Returns the create date of this trash entry.
280            *
281            * @return the create date of this trash entry
282            */
283            @Override
284            public java.util.Date getCreateDate() {
285                    return _trashEntry.getCreateDate();
286            }
287    
288            /**
289            * Sets the create date of this trash entry.
290            *
291            * @param createDate the create date of this trash entry
292            */
293            @Override
294            public void setCreateDate(java.util.Date createDate) {
295                    _trashEntry.setCreateDate(createDate);
296            }
297    
298            /**
299            * Returns the fully qualified class name of this trash entry.
300            *
301            * @return the fully qualified class name of this trash entry
302            */
303            @Override
304            public java.lang.String getClassName() {
305                    return _trashEntry.getClassName();
306            }
307    
308            @Override
309            public void setClassName(java.lang.String className) {
310                    _trashEntry.setClassName(className);
311            }
312    
313            /**
314            * Returns the class name ID of this trash entry.
315            *
316            * @return the class name ID of this trash entry
317            */
318            @Override
319            public long getClassNameId() {
320                    return _trashEntry.getClassNameId();
321            }
322    
323            /**
324            * Sets the class name ID of this trash entry.
325            *
326            * @param classNameId the class name ID of this trash entry
327            */
328            @Override
329            public void setClassNameId(long classNameId) {
330                    _trashEntry.setClassNameId(classNameId);
331            }
332    
333            /**
334            * Returns the class p k of this trash entry.
335            *
336            * @return the class p k of this trash entry
337            */
338            @Override
339            public long getClassPK() {
340                    return _trashEntry.getClassPK();
341            }
342    
343            /**
344            * Sets the class p k of this trash entry.
345            *
346            * @param classPK the class p k of this trash entry
347            */
348            @Override
349            public void setClassPK(long classPK) {
350                    _trashEntry.setClassPK(classPK);
351            }
352    
353            /**
354            * Returns the system event set key of this trash entry.
355            *
356            * @return the system event set key of this trash entry
357            */
358            @Override
359            public long getSystemEventSetKey() {
360                    return _trashEntry.getSystemEventSetKey();
361            }
362    
363            /**
364            * Sets the system event set key of this trash entry.
365            *
366            * @param systemEventSetKey the system event set key of this trash entry
367            */
368            @Override
369            public void setSystemEventSetKey(long systemEventSetKey) {
370                    _trashEntry.setSystemEventSetKey(systemEventSetKey);
371            }
372    
373            /**
374            * Returns the type settings of this trash entry.
375            *
376            * @return the type settings of this trash entry
377            */
378            @Override
379            public java.lang.String getTypeSettings() {
380                    return _trashEntry.getTypeSettings();
381            }
382    
383            /**
384            * Sets the type settings of this trash entry.
385            *
386            * @param typeSettings the type settings of this trash entry
387            */
388            @Override
389            public void setTypeSettings(java.lang.String typeSettings) {
390                    _trashEntry.setTypeSettings(typeSettings);
391            }
392    
393            /**
394            * Returns the status of this trash entry.
395            *
396            * @return the status of this trash entry
397            */
398            @Override
399            public int getStatus() {
400                    return _trashEntry.getStatus();
401            }
402    
403            /**
404            * Sets the status of this trash entry.
405            *
406            * @param status the status of this trash entry
407            */
408            @Override
409            public void setStatus(int status) {
410                    _trashEntry.setStatus(status);
411            }
412    
413            @Override
414            public boolean isNew() {
415                    return _trashEntry.isNew();
416            }
417    
418            @Override
419            public void setNew(boolean n) {
420                    _trashEntry.setNew(n);
421            }
422    
423            @Override
424            public boolean isCachedModel() {
425                    return _trashEntry.isCachedModel();
426            }
427    
428            @Override
429            public void setCachedModel(boolean cachedModel) {
430                    _trashEntry.setCachedModel(cachedModel);
431            }
432    
433            @Override
434            public boolean isEscapedModel() {
435                    return _trashEntry.isEscapedModel();
436            }
437    
438            @Override
439            public java.io.Serializable getPrimaryKeyObj() {
440                    return _trashEntry.getPrimaryKeyObj();
441            }
442    
443            @Override
444            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
445                    _trashEntry.setPrimaryKeyObj(primaryKeyObj);
446            }
447    
448            @Override
449            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
450                    return _trashEntry.getExpandoBridge();
451            }
452    
453            @Override
454            public void setExpandoBridgeAttributes(
455                    com.liferay.portal.model.BaseModel<?> baseModel) {
456                    _trashEntry.setExpandoBridgeAttributes(baseModel);
457            }
458    
459            @Override
460            public void setExpandoBridgeAttributes(
461                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
462                    _trashEntry.setExpandoBridgeAttributes(expandoBridge);
463            }
464    
465            @Override
466            public void setExpandoBridgeAttributes(
467                    com.liferay.portal.service.ServiceContext serviceContext) {
468                    _trashEntry.setExpandoBridgeAttributes(serviceContext);
469            }
470    
471            @Override
472            public java.lang.Object clone() {
473                    return new TrashEntryWrapper((TrashEntry)_trashEntry.clone());
474            }
475    
476            @Override
477            public int compareTo(com.liferay.portlet.trash.model.TrashEntry trashEntry) {
478                    return _trashEntry.compareTo(trashEntry);
479            }
480    
481            @Override
482            public int hashCode() {
483                    return _trashEntry.hashCode();
484            }
485    
486            @Override
487            public com.liferay.portal.model.CacheModel<com.liferay.portlet.trash.model.TrashEntry> toCacheModel() {
488                    return _trashEntry.toCacheModel();
489            }
490    
491            @Override
492            public com.liferay.portlet.trash.model.TrashEntry toEscapedModel() {
493                    return new TrashEntryWrapper(_trashEntry.toEscapedModel());
494            }
495    
496            @Override
497            public com.liferay.portlet.trash.model.TrashEntry toUnescapedModel() {
498                    return new TrashEntryWrapper(_trashEntry.toUnescapedModel());
499            }
500    
501            @Override
502            public java.lang.String toString() {
503                    return _trashEntry.toString();
504            }
505    
506            @Override
507            public java.lang.String toXmlString() {
508                    return _trashEntry.toXmlString();
509            }
510    
511            @Override
512            public void persist()
513                    throws com.liferay.portal.kernel.exception.SystemException {
514                    _trashEntry.persist();
515            }
516    
517            @Override
518            public com.liferay.portlet.trash.model.TrashEntry getRootEntry() {
519                    return _trashEntry.getRootEntry();
520            }
521    
522            @Override
523            public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties() {
524                    return _trashEntry.getTypeSettingsProperties();
525            }
526    
527            @Override
528            public java.lang.String getTypeSettingsProperty(java.lang.String key) {
529                    return _trashEntry.getTypeSettingsProperty(key);
530            }
531    
532            @Override
533            public java.lang.String getTypeSettingsProperty(java.lang.String key,
534                    java.lang.String defaultValue) {
535                    return _trashEntry.getTypeSettingsProperty(key, defaultValue);
536            }
537    
538            @Override
539            public boolean isTrashEntry(java.lang.Class<?> clazz, long classPK) {
540                    return _trashEntry.isTrashEntry(clazz, classPK);
541            }
542    
543            @Override
544            public boolean isTrashEntry(
545                    com.liferay.portal.model.TrashedModel trashedModel) {
546                    return _trashEntry.isTrashEntry(trashedModel);
547            }
548    
549            @Override
550            public void setRootEntry(
551                    com.liferay.portlet.trash.model.TrashEntry rootEntry) {
552                    _trashEntry.setRootEntry(rootEntry);
553            }
554    
555            @Override
556            public void setTypeSettingsProperties(
557                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
558                    _trashEntry.setTypeSettingsProperties(typeSettingsProperties);
559            }
560    
561            @Override
562            public boolean equals(Object obj) {
563                    if (this == obj) {
564                            return true;
565                    }
566    
567                    if (!(obj instanceof TrashEntryWrapper)) {
568                            return false;
569                    }
570    
571                    TrashEntryWrapper trashEntryWrapper = (TrashEntryWrapper)obj;
572    
573                    if (Validator.equals(_trashEntry, trashEntryWrapper._trashEntry)) {
574                            return true;
575                    }
576    
577                    return false;
578            }
579    
580            /**
581             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
582             */
583            public TrashEntry getWrappedTrashEntry() {
584                    return _trashEntry;
585            }
586    
587            @Override
588            public TrashEntry getWrappedModel() {
589                    return _trashEntry;
590            }
591    
592            @Override
593            public void resetOriginalValues() {
594                    _trashEntry.resetOriginalValues();
595            }
596    
597            private TrashEntry _trashEntry;
598    }