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