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