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