001    /**
002     * Copyright (c) 2000-2012 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.model.ModelWrapper;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link MBDiscussion}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       MBDiscussion
029     * @generated
030     */
031    public class MBDiscussionWrapper implements MBDiscussion,
032            ModelWrapper<MBDiscussion> {
033            public MBDiscussionWrapper(MBDiscussion mbDiscussion) {
034                    _mbDiscussion = mbDiscussion;
035            }
036    
037            public Class<?> getModelClass() {
038                    return MBDiscussion.class;
039            }
040    
041            public String getModelClassName() {
042                    return MBDiscussion.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("discussionId", getDiscussionId());
049                    attributes.put("classNameId", getClassNameId());
050                    attributes.put("classPK", getClassPK());
051                    attributes.put("threadId", getThreadId());
052    
053                    return attributes;
054            }
055    
056            public void setModelAttributes(Map<String, Object> attributes) {
057                    Long discussionId = (Long)attributes.get("discussionId");
058    
059                    if (discussionId != null) {
060                            setDiscussionId(discussionId);
061                    }
062    
063                    Long classNameId = (Long)attributes.get("classNameId");
064    
065                    if (classNameId != null) {
066                            setClassNameId(classNameId);
067                    }
068    
069                    Long classPK = (Long)attributes.get("classPK");
070    
071                    if (classPK != null) {
072                            setClassPK(classPK);
073                    }
074    
075                    Long threadId = (Long)attributes.get("threadId");
076    
077                    if (threadId != null) {
078                            setThreadId(threadId);
079                    }
080            }
081    
082            /**
083            * Returns the primary key of this message boards discussion.
084            *
085            * @return the primary key of this message boards discussion
086            */
087            public long getPrimaryKey() {
088                    return _mbDiscussion.getPrimaryKey();
089            }
090    
091            /**
092            * Sets the primary key of this message boards discussion.
093            *
094            * @param primaryKey the primary key of this message boards discussion
095            */
096            public void setPrimaryKey(long primaryKey) {
097                    _mbDiscussion.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the discussion ID of this message boards discussion.
102            *
103            * @return the discussion ID of this message boards discussion
104            */
105            public long getDiscussionId() {
106                    return _mbDiscussion.getDiscussionId();
107            }
108    
109            /**
110            * Sets the discussion ID of this message boards discussion.
111            *
112            * @param discussionId the discussion ID of this message boards discussion
113            */
114            public void setDiscussionId(long discussionId) {
115                    _mbDiscussion.setDiscussionId(discussionId);
116            }
117    
118            /**
119            * Returns the fully qualified class name of this message boards discussion.
120            *
121            * @return the fully qualified class name of this message boards discussion
122            */
123            public java.lang.String getClassName() {
124                    return _mbDiscussion.getClassName();
125            }
126    
127            public void setClassName(java.lang.String className) {
128                    _mbDiscussion.setClassName(className);
129            }
130    
131            /**
132            * Returns the class name ID of this message boards discussion.
133            *
134            * @return the class name ID of this message boards discussion
135            */
136            public long getClassNameId() {
137                    return _mbDiscussion.getClassNameId();
138            }
139    
140            /**
141            * Sets the class name ID of this message boards discussion.
142            *
143            * @param classNameId the class name ID of this message boards discussion
144            */
145            public void setClassNameId(long classNameId) {
146                    _mbDiscussion.setClassNameId(classNameId);
147            }
148    
149            /**
150            * Returns the class p k of this message boards discussion.
151            *
152            * @return the class p k of this message boards discussion
153            */
154            public long getClassPK() {
155                    return _mbDiscussion.getClassPK();
156            }
157    
158            /**
159            * Sets the class p k of this message boards discussion.
160            *
161            * @param classPK the class p k of this message boards discussion
162            */
163            public void setClassPK(long classPK) {
164                    _mbDiscussion.setClassPK(classPK);
165            }
166    
167            /**
168            * Returns the thread ID of this message boards discussion.
169            *
170            * @return the thread ID of this message boards discussion
171            */
172            public long getThreadId() {
173                    return _mbDiscussion.getThreadId();
174            }
175    
176            /**
177            * Sets the thread ID of this message boards discussion.
178            *
179            * @param threadId the thread ID of this message boards discussion
180            */
181            public void setThreadId(long threadId) {
182                    _mbDiscussion.setThreadId(threadId);
183            }
184    
185            public boolean isNew() {
186                    return _mbDiscussion.isNew();
187            }
188    
189            public void setNew(boolean n) {
190                    _mbDiscussion.setNew(n);
191            }
192    
193            public boolean isCachedModel() {
194                    return _mbDiscussion.isCachedModel();
195            }
196    
197            public void setCachedModel(boolean cachedModel) {
198                    _mbDiscussion.setCachedModel(cachedModel);
199            }
200    
201            public boolean isEscapedModel() {
202                    return _mbDiscussion.isEscapedModel();
203            }
204    
205            public java.io.Serializable getPrimaryKeyObj() {
206                    return _mbDiscussion.getPrimaryKeyObj();
207            }
208    
209            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
210                    _mbDiscussion.setPrimaryKeyObj(primaryKeyObj);
211            }
212    
213            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
214                    return _mbDiscussion.getExpandoBridge();
215            }
216    
217            public void setExpandoBridgeAttributes(
218                    com.liferay.portal.service.ServiceContext serviceContext) {
219                    _mbDiscussion.setExpandoBridgeAttributes(serviceContext);
220            }
221    
222            @Override
223            public java.lang.Object clone() {
224                    return new MBDiscussionWrapper((MBDiscussion)_mbDiscussion.clone());
225            }
226    
227            public int compareTo(
228                    com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion) {
229                    return _mbDiscussion.compareTo(mbDiscussion);
230            }
231    
232            @Override
233            public int hashCode() {
234                    return _mbDiscussion.hashCode();
235            }
236    
237            public com.liferay.portal.model.CacheModel<com.liferay.portlet.messageboards.model.MBDiscussion> toCacheModel() {
238                    return _mbDiscussion.toCacheModel();
239            }
240    
241            public com.liferay.portlet.messageboards.model.MBDiscussion toEscapedModel() {
242                    return new MBDiscussionWrapper(_mbDiscussion.toEscapedModel());
243            }
244    
245            @Override
246            public java.lang.String toString() {
247                    return _mbDiscussion.toString();
248            }
249    
250            public java.lang.String toXmlString() {
251                    return _mbDiscussion.toXmlString();
252            }
253    
254            public void persist()
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    _mbDiscussion.persist();
257            }
258    
259            /**
260             * @deprecated Renamed to {@link #getWrappedModel}
261             */
262            public MBDiscussion getWrappedMBDiscussion() {
263                    return _mbDiscussion;
264            }
265    
266            public MBDiscussion getWrappedModel() {
267                    return _mbDiscussion;
268            }
269    
270            public void resetOriginalValues() {
271                    _mbDiscussion.resetOriginalValues();
272            }
273    
274            private MBDiscussion _mbDiscussion;
275    }