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