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