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.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            @Override
142            public java.lang.Object clone() {
143                    return new MBDiscussionWrapper((MBDiscussion)_mbDiscussion.clone());
144            }
145    
146            @Override
147            public int compareTo(
148                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
149                    return _mbDiscussion.compareTo(mbDiscussion);
150            }
151    
152            /**
153            * Returns the fully qualified class name of this message boards discussion.
154            *
155            * @return the fully qualified class name of this message boards discussion
156            */
157            @Override
158            public java.lang.String getClassName() {
159                    return _mbDiscussion.getClassName();
160            }
161    
162            /**
163            * Returns the class name ID of this message boards discussion.
164            *
165            * @return the class name ID of this message boards discussion
166            */
167            @Override
168            public long getClassNameId() {
169                    return _mbDiscussion.getClassNameId();
170            }
171    
172            /**
173            * Returns the class p k of this message boards discussion.
174            *
175            * @return the class p k of this message boards discussion
176            */
177            @Override
178            public long getClassPK() {
179                    return _mbDiscussion.getClassPK();
180            }
181    
182            /**
183            * Returns the company ID of this message boards discussion.
184            *
185            * @return the company ID of this message boards discussion
186            */
187            @Override
188            public long getCompanyId() {
189                    return _mbDiscussion.getCompanyId();
190            }
191    
192            /**
193            * Returns the create date of this message boards discussion.
194            *
195            * @return the create date of this message boards discussion
196            */
197            @Override
198            public java.util.Date getCreateDate() {
199                    return _mbDiscussion.getCreateDate();
200            }
201    
202            /**
203            * Returns the discussion ID of this message boards discussion.
204            *
205            * @return the discussion ID of this message boards discussion
206            */
207            @Override
208            public long getDiscussionId() {
209                    return _mbDiscussion.getDiscussionId();
210            }
211    
212            @Override
213            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
214                    return _mbDiscussion.getExpandoBridge();
215            }
216    
217            /**
218            * Returns the group ID of this message boards discussion.
219            *
220            * @return the group ID of this message boards discussion
221            */
222            @Override
223            public long getGroupId() {
224                    return _mbDiscussion.getGroupId();
225            }
226    
227            /**
228            * Returns the modified date of this message boards discussion.
229            *
230            * @return the modified date of this message boards discussion
231            */
232            @Override
233            public java.util.Date getModifiedDate() {
234                    return _mbDiscussion.getModifiedDate();
235            }
236    
237            /**
238            * Returns the primary key of this message boards discussion.
239            *
240            * @return the primary key of this message boards discussion
241            */
242            @Override
243            public long getPrimaryKey() {
244                    return _mbDiscussion.getPrimaryKey();
245            }
246    
247            @Override
248            public java.io.Serializable getPrimaryKeyObj() {
249                    return _mbDiscussion.getPrimaryKeyObj();
250            }
251    
252            /**
253            * Returns the thread ID of this message boards discussion.
254            *
255            * @return the thread ID of this message boards discussion
256            */
257            @Override
258            public long getThreadId() {
259                    return _mbDiscussion.getThreadId();
260            }
261    
262            /**
263            * Returns the user ID of this message boards discussion.
264            *
265            * @return the user ID of this message boards discussion
266            */
267            @Override
268            public long getUserId() {
269                    return _mbDiscussion.getUserId();
270            }
271    
272            /**
273            * Returns the user name of this message boards discussion.
274            *
275            * @return the user name of this message boards discussion
276            */
277            @Override
278            public java.lang.String getUserName() {
279                    return _mbDiscussion.getUserName();
280            }
281    
282            /**
283            * Returns the user uuid of this message boards discussion.
284            *
285            * @return the user uuid of this message boards discussion
286            */
287            @Override
288            public java.lang.String getUserUuid() {
289                    return _mbDiscussion.getUserUuid();
290            }
291    
292            /**
293            * Returns the uuid of this message boards discussion.
294            *
295            * @return the uuid of this message boards discussion
296            */
297            @Override
298            public java.lang.String getUuid() {
299                    return _mbDiscussion.getUuid();
300            }
301    
302            @Override
303            public int hashCode() {
304                    return _mbDiscussion.hashCode();
305            }
306    
307            @Override
308            public boolean isCachedModel() {
309                    return _mbDiscussion.isCachedModel();
310            }
311    
312            @Override
313            public boolean isEscapedModel() {
314                    return _mbDiscussion.isEscapedModel();
315            }
316    
317            @Override
318            public boolean isNew() {
319                    return _mbDiscussion.isNew();
320            }
321    
322            @Override
323            public void persist() {
324                    _mbDiscussion.persist();
325            }
326    
327            @Override
328            public void setCachedModel(boolean cachedModel) {
329                    _mbDiscussion.setCachedModel(cachedModel);
330            }
331    
332            @Override
333            public void setClassName(java.lang.String className) {
334                    _mbDiscussion.setClassName(className);
335            }
336    
337            /**
338            * Sets the class name ID of this message boards discussion.
339            *
340            * @param classNameId the class name ID of this message boards discussion
341            */
342            @Override
343            public void setClassNameId(long classNameId) {
344                    _mbDiscussion.setClassNameId(classNameId);
345            }
346    
347            /**
348            * Sets the class p k of this message boards discussion.
349            *
350            * @param classPK the class p k of this message boards discussion
351            */
352            @Override
353            public void setClassPK(long classPK) {
354                    _mbDiscussion.setClassPK(classPK);
355            }
356    
357            /**
358            * Sets the company ID of this message boards discussion.
359            *
360            * @param companyId the company ID of this message boards discussion
361            */
362            @Override
363            public void setCompanyId(long companyId) {
364                    _mbDiscussion.setCompanyId(companyId);
365            }
366    
367            /**
368            * Sets the create date of this message boards discussion.
369            *
370            * @param createDate the create date of this message boards discussion
371            */
372            @Override
373            public void setCreateDate(java.util.Date createDate) {
374                    _mbDiscussion.setCreateDate(createDate);
375            }
376    
377            /**
378            * Sets the discussion ID of this message boards discussion.
379            *
380            * @param discussionId the discussion ID of this message boards discussion
381            */
382            @Override
383            public void setDiscussionId(long discussionId) {
384                    _mbDiscussion.setDiscussionId(discussionId);
385            }
386    
387            @Override
388            public void setExpandoBridgeAttributes(
389                    com.liferay.portal.model.BaseModel<?> baseModel) {
390                    _mbDiscussion.setExpandoBridgeAttributes(baseModel);
391            }
392    
393            @Override
394            public void setExpandoBridgeAttributes(
395                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
396                    _mbDiscussion.setExpandoBridgeAttributes(expandoBridge);
397            }
398    
399            @Override
400            public void setExpandoBridgeAttributes(
401                    com.liferay.portal.service.ServiceContext serviceContext) {
402                    _mbDiscussion.setExpandoBridgeAttributes(serviceContext);
403            }
404    
405            /**
406            * Sets the group ID of this message boards discussion.
407            *
408            * @param groupId the group ID of this message boards discussion
409            */
410            @Override
411            public void setGroupId(long groupId) {
412                    _mbDiscussion.setGroupId(groupId);
413            }
414    
415            /**
416            * Sets the modified date of this message boards discussion.
417            *
418            * @param modifiedDate the modified date of this message boards discussion
419            */
420            @Override
421            public void setModifiedDate(java.util.Date modifiedDate) {
422                    _mbDiscussion.setModifiedDate(modifiedDate);
423            }
424    
425            @Override
426            public void setNew(boolean n) {
427                    _mbDiscussion.setNew(n);
428            }
429    
430            /**
431            * Sets the primary key of this message boards discussion.
432            *
433            * @param primaryKey the primary key of this message boards discussion
434            */
435            @Override
436            public void setPrimaryKey(long primaryKey) {
437                    _mbDiscussion.setPrimaryKey(primaryKey);
438            }
439    
440            @Override
441            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
442                    _mbDiscussion.setPrimaryKeyObj(primaryKeyObj);
443            }
444    
445            /**
446            * Sets the thread ID of this message boards discussion.
447            *
448            * @param threadId the thread ID of this message boards discussion
449            */
450            @Override
451            public void setThreadId(long threadId) {
452                    _mbDiscussion.setThreadId(threadId);
453            }
454    
455            /**
456            * Sets the user ID of this message boards discussion.
457            *
458            * @param userId the user ID of this message boards discussion
459            */
460            @Override
461            public void setUserId(long userId) {
462                    _mbDiscussion.setUserId(userId);
463            }
464    
465            /**
466            * Sets the user name of this message boards discussion.
467            *
468            * @param userName the user name of this message boards discussion
469            */
470            @Override
471            public void setUserName(java.lang.String userName) {
472                    _mbDiscussion.setUserName(userName);
473            }
474    
475            /**
476            * Sets the user uuid of this message boards discussion.
477            *
478            * @param userUuid the user uuid of this message boards discussion
479            */
480            @Override
481            public void setUserUuid(java.lang.String userUuid) {
482                    _mbDiscussion.setUserUuid(userUuid);
483            }
484    
485            /**
486            * Sets the uuid of this message boards discussion.
487            *
488            * @param uuid the uuid of this message boards discussion
489            */
490            @Override
491            public void setUuid(java.lang.String uuid) {
492                    _mbDiscussion.setUuid(uuid);
493            }
494    
495            @Override
496            public com.liferay.portal.model.CacheModel<com.liferay.portlet.messageboards.model.MBDiscussion> toCacheModel() {
497                    return _mbDiscussion.toCacheModel();
498            }
499    
500            @Override
501            public com.liferay.portlet.messageboards.model.MBDiscussion toEscapedModel() {
502                    return new MBDiscussionWrapper(_mbDiscussion.toEscapedModel());
503            }
504    
505            @Override
506            public java.lang.String toString() {
507                    return _mbDiscussion.toString();
508            }
509    
510            @Override
511            public com.liferay.portlet.messageboards.model.MBDiscussion toUnescapedModel() {
512                    return new MBDiscussionWrapper(_mbDiscussion.toUnescapedModel());
513            }
514    
515            @Override
516            public java.lang.String toXmlString() {
517                    return _mbDiscussion.toXmlString();
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            @Deprecated
548            public MBDiscussion getWrappedMBDiscussion() {
549                    return _mbDiscussion;
550            }
551    
552            @Override
553            public MBDiscussion getWrappedModel() {
554                    return _mbDiscussion;
555            }
556    
557            @Override
558            public boolean isEntityCacheEnabled() {
559                    return _mbDiscussion.isEntityCacheEnabled();
560            }
561    
562            @Override
563            public boolean isFinderCacheEnabled() {
564                    return _mbDiscussion.isFinderCacheEnabled();
565            }
566    
567            @Override
568            public void resetOriginalValues() {
569                    _mbDiscussion.resetOriginalValues();
570            }
571    
572            private final MBDiscussion _mbDiscussion;
573    }