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