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