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