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