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.bookmarks.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 BookmarksFolder}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       BookmarksFolder
031     * @generated
032     */
033    public class BookmarksFolderWrapper implements BookmarksFolder,
034            ModelWrapper<BookmarksFolder> {
035            public BookmarksFolderWrapper(BookmarksFolder bookmarksFolder) {
036                    _bookmarksFolder = bookmarksFolder;
037            }
038    
039            public Class<?> getModelClass() {
040                    return BookmarksFolder.class;
041            }
042    
043            public String getModelClassName() {
044                    return BookmarksFolder.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("uuid", getUuid());
051                    attributes.put("folderId", getFolderId());
052                    attributes.put("groupId", getGroupId());
053                    attributes.put("companyId", getCompanyId());
054                    attributes.put("userId", getUserId());
055                    attributes.put("userName", getUserName());
056                    attributes.put("createDate", getCreateDate());
057                    attributes.put("modifiedDate", getModifiedDate());
058                    attributes.put("resourceBlockId", getResourceBlockId());
059                    attributes.put("parentFolderId", getParentFolderId());
060                    attributes.put("name", getName());
061                    attributes.put("description", getDescription());
062    
063                    return attributes;
064            }
065    
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    String uuid = (String)attributes.get("uuid");
068    
069                    if (uuid != null) {
070                            setUuid(uuid);
071                    }
072    
073                    Long folderId = (Long)attributes.get("folderId");
074    
075                    if (folderId != null) {
076                            setFolderId(folderId);
077                    }
078    
079                    Long groupId = (Long)attributes.get("groupId");
080    
081                    if (groupId != null) {
082                            setGroupId(groupId);
083                    }
084    
085                    Long companyId = (Long)attributes.get("companyId");
086    
087                    if (companyId != null) {
088                            setCompanyId(companyId);
089                    }
090    
091                    Long userId = (Long)attributes.get("userId");
092    
093                    if (userId != null) {
094                            setUserId(userId);
095                    }
096    
097                    String userName = (String)attributes.get("userName");
098    
099                    if (userName != null) {
100                            setUserName(userName);
101                    }
102    
103                    Date createDate = (Date)attributes.get("createDate");
104    
105                    if (createDate != null) {
106                            setCreateDate(createDate);
107                    }
108    
109                    Date modifiedDate = (Date)attributes.get("modifiedDate");
110    
111                    if (modifiedDate != null) {
112                            setModifiedDate(modifiedDate);
113                    }
114    
115                    Long resourceBlockId = (Long)attributes.get("resourceBlockId");
116    
117                    if (resourceBlockId != null) {
118                            setResourceBlockId(resourceBlockId);
119                    }
120    
121                    Long parentFolderId = (Long)attributes.get("parentFolderId");
122    
123                    if (parentFolderId != null) {
124                            setParentFolderId(parentFolderId);
125                    }
126    
127                    String name = (String)attributes.get("name");
128    
129                    if (name != null) {
130                            setName(name);
131                    }
132    
133                    String description = (String)attributes.get("description");
134    
135                    if (description != null) {
136                            setDescription(description);
137                    }
138            }
139    
140            /**
141            * Returns the primary key of this bookmarks folder.
142            *
143            * @return the primary key of this bookmarks folder
144            */
145            public long getPrimaryKey() {
146                    return _bookmarksFolder.getPrimaryKey();
147            }
148    
149            /**
150            * Sets the primary key of this bookmarks folder.
151            *
152            * @param primaryKey the primary key of this bookmarks folder
153            */
154            public void setPrimaryKey(long primaryKey) {
155                    _bookmarksFolder.setPrimaryKey(primaryKey);
156            }
157    
158            /**
159            * Returns the uuid of this bookmarks folder.
160            *
161            * @return the uuid of this bookmarks folder
162            */
163            public java.lang.String getUuid() {
164                    return _bookmarksFolder.getUuid();
165            }
166    
167            /**
168            * Sets the uuid of this bookmarks folder.
169            *
170            * @param uuid the uuid of this bookmarks folder
171            */
172            public void setUuid(java.lang.String uuid) {
173                    _bookmarksFolder.setUuid(uuid);
174            }
175    
176            /**
177            * Returns the folder ID of this bookmarks folder.
178            *
179            * @return the folder ID of this bookmarks folder
180            */
181            public long getFolderId() {
182                    return _bookmarksFolder.getFolderId();
183            }
184    
185            /**
186            * Sets the folder ID of this bookmarks folder.
187            *
188            * @param folderId the folder ID of this bookmarks folder
189            */
190            public void setFolderId(long folderId) {
191                    _bookmarksFolder.setFolderId(folderId);
192            }
193    
194            /**
195            * Returns the group ID of this bookmarks folder.
196            *
197            * @return the group ID of this bookmarks folder
198            */
199            public long getGroupId() {
200                    return _bookmarksFolder.getGroupId();
201            }
202    
203            /**
204            * Sets the group ID of this bookmarks folder.
205            *
206            * @param groupId the group ID of this bookmarks folder
207            */
208            public void setGroupId(long groupId) {
209                    _bookmarksFolder.setGroupId(groupId);
210            }
211    
212            /**
213            * Returns the company ID of this bookmarks folder.
214            *
215            * @return the company ID of this bookmarks folder
216            */
217            public long getCompanyId() {
218                    return _bookmarksFolder.getCompanyId();
219            }
220    
221            /**
222            * Sets the company ID of this bookmarks folder.
223            *
224            * @param companyId the company ID of this bookmarks folder
225            */
226            public void setCompanyId(long companyId) {
227                    _bookmarksFolder.setCompanyId(companyId);
228            }
229    
230            /**
231            * Returns the user ID of this bookmarks folder.
232            *
233            * @return the user ID of this bookmarks folder
234            */
235            public long getUserId() {
236                    return _bookmarksFolder.getUserId();
237            }
238    
239            /**
240            * Sets the user ID of this bookmarks folder.
241            *
242            * @param userId the user ID of this bookmarks folder
243            */
244            public void setUserId(long userId) {
245                    _bookmarksFolder.setUserId(userId);
246            }
247    
248            /**
249            * Returns the user uuid of this bookmarks folder.
250            *
251            * @return the user uuid of this bookmarks folder
252            * @throws SystemException if a system exception occurred
253            */
254            public java.lang.String getUserUuid()
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    return _bookmarksFolder.getUserUuid();
257            }
258    
259            /**
260            * Sets the user uuid of this bookmarks folder.
261            *
262            * @param userUuid the user uuid of this bookmarks folder
263            */
264            public void setUserUuid(java.lang.String userUuid) {
265                    _bookmarksFolder.setUserUuid(userUuid);
266            }
267    
268            /**
269            * Returns the user name of this bookmarks folder.
270            *
271            * @return the user name of this bookmarks folder
272            */
273            public java.lang.String getUserName() {
274                    return _bookmarksFolder.getUserName();
275            }
276    
277            /**
278            * Sets the user name of this bookmarks folder.
279            *
280            * @param userName the user name of this bookmarks folder
281            */
282            public void setUserName(java.lang.String userName) {
283                    _bookmarksFolder.setUserName(userName);
284            }
285    
286            /**
287            * Returns the create date of this bookmarks folder.
288            *
289            * @return the create date of this bookmarks folder
290            */
291            public java.util.Date getCreateDate() {
292                    return _bookmarksFolder.getCreateDate();
293            }
294    
295            /**
296            * Sets the create date of this bookmarks folder.
297            *
298            * @param createDate the create date of this bookmarks folder
299            */
300            public void setCreateDate(java.util.Date createDate) {
301                    _bookmarksFolder.setCreateDate(createDate);
302            }
303    
304            /**
305            * Returns the modified date of this bookmarks folder.
306            *
307            * @return the modified date of this bookmarks folder
308            */
309            public java.util.Date getModifiedDate() {
310                    return _bookmarksFolder.getModifiedDate();
311            }
312    
313            /**
314            * Sets the modified date of this bookmarks folder.
315            *
316            * @param modifiedDate the modified date of this bookmarks folder
317            */
318            public void setModifiedDate(java.util.Date modifiedDate) {
319                    _bookmarksFolder.setModifiedDate(modifiedDate);
320            }
321    
322            /**
323            * Returns the resource block ID of this bookmarks folder.
324            *
325            * @return the resource block ID of this bookmarks folder
326            */
327            public long getResourceBlockId() {
328                    return _bookmarksFolder.getResourceBlockId();
329            }
330    
331            /**
332            * Sets the resource block ID of this bookmarks folder.
333            *
334            * @param resourceBlockId the resource block ID of this bookmarks folder
335            */
336            public void setResourceBlockId(long resourceBlockId) {
337                    _bookmarksFolder.setResourceBlockId(resourceBlockId);
338            }
339    
340            /**
341            * Returns the parent folder ID of this bookmarks folder.
342            *
343            * @return the parent folder ID of this bookmarks folder
344            */
345            public long getParentFolderId() {
346                    return _bookmarksFolder.getParentFolderId();
347            }
348    
349            /**
350            * Sets the parent folder ID of this bookmarks folder.
351            *
352            * @param parentFolderId the parent folder ID of this bookmarks folder
353            */
354            public void setParentFolderId(long parentFolderId) {
355                    _bookmarksFolder.setParentFolderId(parentFolderId);
356            }
357    
358            /**
359            * Returns the name of this bookmarks folder.
360            *
361            * @return the name of this bookmarks folder
362            */
363            public java.lang.String getName() {
364                    return _bookmarksFolder.getName();
365            }
366    
367            /**
368            * Sets the name of this bookmarks folder.
369            *
370            * @param name the name of this bookmarks folder
371            */
372            public void setName(java.lang.String name) {
373                    _bookmarksFolder.setName(name);
374            }
375    
376            /**
377            * Returns the description of this bookmarks folder.
378            *
379            * @return the description of this bookmarks folder
380            */
381            public java.lang.String getDescription() {
382                    return _bookmarksFolder.getDescription();
383            }
384    
385            /**
386            * Sets the description of this bookmarks folder.
387            *
388            * @param description the description of this bookmarks folder
389            */
390            public void setDescription(java.lang.String description) {
391                    _bookmarksFolder.setDescription(description);
392            }
393    
394            public boolean isNew() {
395                    return _bookmarksFolder.isNew();
396            }
397    
398            public void setNew(boolean n) {
399                    _bookmarksFolder.setNew(n);
400            }
401    
402            public boolean isCachedModel() {
403                    return _bookmarksFolder.isCachedModel();
404            }
405    
406            public void setCachedModel(boolean cachedModel) {
407                    _bookmarksFolder.setCachedModel(cachedModel);
408            }
409    
410            public boolean isEscapedModel() {
411                    return _bookmarksFolder.isEscapedModel();
412            }
413    
414            public java.io.Serializable getPrimaryKeyObj() {
415                    return _bookmarksFolder.getPrimaryKeyObj();
416            }
417    
418            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
419                    _bookmarksFolder.setPrimaryKeyObj(primaryKeyObj);
420            }
421    
422            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
423                    return _bookmarksFolder.getExpandoBridge();
424            }
425    
426            public void setExpandoBridgeAttributes(
427                    com.liferay.portal.service.ServiceContext serviceContext) {
428                    _bookmarksFolder.setExpandoBridgeAttributes(serviceContext);
429            }
430    
431            @Override
432            public java.lang.Object clone() {
433                    return new BookmarksFolderWrapper((BookmarksFolder)_bookmarksFolder.clone());
434            }
435    
436            public int compareTo(
437                    com.liferay.portlet.bookmarks.model.BookmarksFolder bookmarksFolder) {
438                    return _bookmarksFolder.compareTo(bookmarksFolder);
439            }
440    
441            @Override
442            public int hashCode() {
443                    return _bookmarksFolder.hashCode();
444            }
445    
446            public com.liferay.portal.model.CacheModel<com.liferay.portlet.bookmarks.model.BookmarksFolder> toCacheModel() {
447                    return _bookmarksFolder.toCacheModel();
448            }
449    
450            public com.liferay.portlet.bookmarks.model.BookmarksFolder toEscapedModel() {
451                    return new BookmarksFolderWrapper(_bookmarksFolder.toEscapedModel());
452            }
453    
454            public com.liferay.portlet.bookmarks.model.BookmarksFolder toUnescapedModel() {
455                    return new BookmarksFolderWrapper(_bookmarksFolder.toUnescapedModel());
456            }
457    
458            @Override
459            public java.lang.String toString() {
460                    return _bookmarksFolder.toString();
461            }
462    
463            public java.lang.String toXmlString() {
464                    return _bookmarksFolder.toXmlString();
465            }
466    
467            public void persist()
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    _bookmarksFolder.persist();
470            }
471    
472            public java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> getAncestors()
473                    throws com.liferay.portal.kernel.exception.PortalException,
474                            com.liferay.portal.kernel.exception.SystemException {
475                    return _bookmarksFolder.getAncestors();
476            }
477    
478            public com.liferay.portlet.bookmarks.model.BookmarksFolder getParentFolder()
479                    throws com.liferay.portal.kernel.exception.PortalException,
480                            com.liferay.portal.kernel.exception.SystemException {
481                    return _bookmarksFolder.getParentFolder();
482            }
483    
484            public boolean isRoot() {
485                    return _bookmarksFolder.isRoot();
486            }
487    
488            @Override
489            public boolean equals(Object obj) {
490                    if (this == obj) {
491                            return true;
492                    }
493    
494                    if (!(obj instanceof BookmarksFolderWrapper)) {
495                            return false;
496                    }
497    
498                    BookmarksFolderWrapper bookmarksFolderWrapper = (BookmarksFolderWrapper)obj;
499    
500                    if (Validator.equals(_bookmarksFolder,
501                                            bookmarksFolderWrapper._bookmarksFolder)) {
502                            return true;
503                    }
504    
505                    return false;
506            }
507    
508            /**
509             * @deprecated Renamed to {@link #getWrappedModel}
510             */
511            public BookmarksFolder getWrappedBookmarksFolder() {
512                    return _bookmarksFolder;
513            }
514    
515            public BookmarksFolder getWrappedModel() {
516                    return _bookmarksFolder;
517            }
518    
519            public void resetOriginalValues() {
520                    _bookmarksFolder.resetOriginalValues();
521            }
522    
523            private BookmarksFolder _bookmarksFolder;
524    }