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.polls.model;
016    
017    import com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link PollsQuestion}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       PollsQuestion
030     * @generated
031     */
032    public class PollsQuestionWrapper implements PollsQuestion,
033            ModelWrapper<PollsQuestion> {
034            public PollsQuestionWrapper(PollsQuestion pollsQuestion) {
035                    _pollsQuestion = pollsQuestion;
036            }
037    
038            public Class<?> getModelClass() {
039                    return PollsQuestion.class;
040            }
041    
042            public String getModelClassName() {
043                    return PollsQuestion.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("questionId", getQuestionId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("createDate", getCreateDate());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("title", getTitle());
058                    attributes.put("description", getDescription());
059                    attributes.put("expirationDate", getExpirationDate());
060                    attributes.put("lastVoteDate", getLastVoteDate());
061    
062                    return attributes;
063            }
064    
065            public void setModelAttributes(Map<String, Object> attributes) {
066                    String uuid = (String)attributes.get("uuid");
067    
068                    if (uuid != null) {
069                            setUuid(uuid);
070                    }
071    
072                    Long questionId = (Long)attributes.get("questionId");
073    
074                    if (questionId != null) {
075                            setQuestionId(questionId);
076                    }
077    
078                    Long groupId = (Long)attributes.get("groupId");
079    
080                    if (groupId != null) {
081                            setGroupId(groupId);
082                    }
083    
084                    Long companyId = (Long)attributes.get("companyId");
085    
086                    if (companyId != null) {
087                            setCompanyId(companyId);
088                    }
089    
090                    Long userId = (Long)attributes.get("userId");
091    
092                    if (userId != null) {
093                            setUserId(userId);
094                    }
095    
096                    String userName = (String)attributes.get("userName");
097    
098                    if (userName != null) {
099                            setUserName(userName);
100                    }
101    
102                    Date createDate = (Date)attributes.get("createDate");
103    
104                    if (createDate != null) {
105                            setCreateDate(createDate);
106                    }
107    
108                    Date modifiedDate = (Date)attributes.get("modifiedDate");
109    
110                    if (modifiedDate != null) {
111                            setModifiedDate(modifiedDate);
112                    }
113    
114                    String title = (String)attributes.get("title");
115    
116                    if (title != null) {
117                            setTitle(title);
118                    }
119    
120                    String description = (String)attributes.get("description");
121    
122                    if (description != null) {
123                            setDescription(description);
124                    }
125    
126                    Date expirationDate = (Date)attributes.get("expirationDate");
127    
128                    if (expirationDate != null) {
129                            setExpirationDate(expirationDate);
130                    }
131    
132                    Date lastVoteDate = (Date)attributes.get("lastVoteDate");
133    
134                    if (lastVoteDate != null) {
135                            setLastVoteDate(lastVoteDate);
136                    }
137            }
138    
139            /**
140            * Returns the primary key of this polls question.
141            *
142            * @return the primary key of this polls question
143            */
144            public long getPrimaryKey() {
145                    return _pollsQuestion.getPrimaryKey();
146            }
147    
148            /**
149            * Sets the primary key of this polls question.
150            *
151            * @param primaryKey the primary key of this polls question
152            */
153            public void setPrimaryKey(long primaryKey) {
154                    _pollsQuestion.setPrimaryKey(primaryKey);
155            }
156    
157            /**
158            * Returns the uuid of this polls question.
159            *
160            * @return the uuid of this polls question
161            */
162            public java.lang.String getUuid() {
163                    return _pollsQuestion.getUuid();
164            }
165    
166            /**
167            * Sets the uuid of this polls question.
168            *
169            * @param uuid the uuid of this polls question
170            */
171            public void setUuid(java.lang.String uuid) {
172                    _pollsQuestion.setUuid(uuid);
173            }
174    
175            /**
176            * Returns the question ID of this polls question.
177            *
178            * @return the question ID of this polls question
179            */
180            public long getQuestionId() {
181                    return _pollsQuestion.getQuestionId();
182            }
183    
184            /**
185            * Sets the question ID of this polls question.
186            *
187            * @param questionId the question ID of this polls question
188            */
189            public void setQuestionId(long questionId) {
190                    _pollsQuestion.setQuestionId(questionId);
191            }
192    
193            /**
194            * Returns the group ID of this polls question.
195            *
196            * @return the group ID of this polls question
197            */
198            public long getGroupId() {
199                    return _pollsQuestion.getGroupId();
200            }
201    
202            /**
203            * Sets the group ID of this polls question.
204            *
205            * @param groupId the group ID of this polls question
206            */
207            public void setGroupId(long groupId) {
208                    _pollsQuestion.setGroupId(groupId);
209            }
210    
211            /**
212            * Returns the company ID of this polls question.
213            *
214            * @return the company ID of this polls question
215            */
216            public long getCompanyId() {
217                    return _pollsQuestion.getCompanyId();
218            }
219    
220            /**
221            * Sets the company ID of this polls question.
222            *
223            * @param companyId the company ID of this polls question
224            */
225            public void setCompanyId(long companyId) {
226                    _pollsQuestion.setCompanyId(companyId);
227            }
228    
229            /**
230            * Returns the user ID of this polls question.
231            *
232            * @return the user ID of this polls question
233            */
234            public long getUserId() {
235                    return _pollsQuestion.getUserId();
236            }
237    
238            /**
239            * Sets the user ID of this polls question.
240            *
241            * @param userId the user ID of this polls question
242            */
243            public void setUserId(long userId) {
244                    _pollsQuestion.setUserId(userId);
245            }
246    
247            /**
248            * Returns the user uuid of this polls question.
249            *
250            * @return the user uuid of this polls question
251            * @throws SystemException if a system exception occurred
252            */
253            public java.lang.String getUserUuid()
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    return _pollsQuestion.getUserUuid();
256            }
257    
258            /**
259            * Sets the user uuid of this polls question.
260            *
261            * @param userUuid the user uuid of this polls question
262            */
263            public void setUserUuid(java.lang.String userUuid) {
264                    _pollsQuestion.setUserUuid(userUuid);
265            }
266    
267            /**
268            * Returns the user name of this polls question.
269            *
270            * @return the user name of this polls question
271            */
272            public java.lang.String getUserName() {
273                    return _pollsQuestion.getUserName();
274            }
275    
276            /**
277            * Sets the user name of this polls question.
278            *
279            * @param userName the user name of this polls question
280            */
281            public void setUserName(java.lang.String userName) {
282                    _pollsQuestion.setUserName(userName);
283            }
284    
285            /**
286            * Returns the create date of this polls question.
287            *
288            * @return the create date of this polls question
289            */
290            public java.util.Date getCreateDate() {
291                    return _pollsQuestion.getCreateDate();
292            }
293    
294            /**
295            * Sets the create date of this polls question.
296            *
297            * @param createDate the create date of this polls question
298            */
299            public void setCreateDate(java.util.Date createDate) {
300                    _pollsQuestion.setCreateDate(createDate);
301            }
302    
303            /**
304            * Returns the modified date of this polls question.
305            *
306            * @return the modified date of this polls question
307            */
308            public java.util.Date getModifiedDate() {
309                    return _pollsQuestion.getModifiedDate();
310            }
311    
312            /**
313            * Sets the modified date of this polls question.
314            *
315            * @param modifiedDate the modified date of this polls question
316            */
317            public void setModifiedDate(java.util.Date modifiedDate) {
318                    _pollsQuestion.setModifiedDate(modifiedDate);
319            }
320    
321            /**
322            * Returns the title of this polls question.
323            *
324            * @return the title of this polls question
325            */
326            public java.lang.String getTitle() {
327                    return _pollsQuestion.getTitle();
328            }
329    
330            /**
331            * Returns the localized title of this polls question in the language. Uses the default language if no localization exists for the requested language.
332            *
333            * @param locale the locale of the language
334            * @return the localized title of this polls question
335            */
336            public java.lang.String getTitle(java.util.Locale locale) {
337                    return _pollsQuestion.getTitle(locale);
338            }
339    
340            /**
341            * Returns the localized title of this polls question in the language, optionally using the default language if no localization exists for the requested language.
342            *
343            * @param locale the local of the language
344            * @param useDefault whether to use the default language if no localization exists for the requested language
345            * @return the localized title of this polls question. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
346            */
347            public java.lang.String getTitle(java.util.Locale locale, boolean useDefault) {
348                    return _pollsQuestion.getTitle(locale, useDefault);
349            }
350    
351            /**
352            * Returns the localized title of this polls question in the language. Uses the default language if no localization exists for the requested language.
353            *
354            * @param languageId the ID of the language
355            * @return the localized title of this polls question
356            */
357            public java.lang.String getTitle(java.lang.String languageId) {
358                    return _pollsQuestion.getTitle(languageId);
359            }
360    
361            /**
362            * Returns the localized title of this polls question in the language, optionally using the default language if no localization exists for the requested language.
363            *
364            * @param languageId the ID of the language
365            * @param useDefault whether to use the default language if no localization exists for the requested language
366            * @return the localized title of this polls question
367            */
368            public java.lang.String getTitle(java.lang.String languageId,
369                    boolean useDefault) {
370                    return _pollsQuestion.getTitle(languageId, useDefault);
371            }
372    
373            public java.lang.String getTitleCurrentLanguageId() {
374                    return _pollsQuestion.getTitleCurrentLanguageId();
375            }
376    
377            public java.lang.String getTitleCurrentValue() {
378                    return _pollsQuestion.getTitleCurrentValue();
379            }
380    
381            /**
382            * Returns a map of the locales and localized titles of this polls question.
383            *
384            * @return the locales and localized titles of this polls question
385            */
386            public java.util.Map<java.util.Locale, java.lang.String> getTitleMap() {
387                    return _pollsQuestion.getTitleMap();
388            }
389    
390            /**
391            * Sets the title of this polls question.
392            *
393            * @param title the title of this polls question
394            */
395            public void setTitle(java.lang.String title) {
396                    _pollsQuestion.setTitle(title);
397            }
398    
399            /**
400            * Sets the localized title of this polls question in the language.
401            *
402            * @param title the localized title of this polls question
403            * @param locale the locale of the language
404            */
405            public void setTitle(java.lang.String title, java.util.Locale locale) {
406                    _pollsQuestion.setTitle(title, locale);
407            }
408    
409            /**
410            * Sets the localized title of this polls question in the language, and sets the default locale.
411            *
412            * @param title the localized title of this polls question
413            * @param locale the locale of the language
414            * @param defaultLocale the default locale
415            */
416            public void setTitle(java.lang.String title, java.util.Locale locale,
417                    java.util.Locale defaultLocale) {
418                    _pollsQuestion.setTitle(title, locale, defaultLocale);
419            }
420    
421            public void setTitleCurrentLanguageId(java.lang.String languageId) {
422                    _pollsQuestion.setTitleCurrentLanguageId(languageId);
423            }
424    
425            /**
426            * Sets the localized titles of this polls question from the map of locales and localized titles.
427            *
428            * @param titleMap the locales and localized titles of this polls question
429            */
430            public void setTitleMap(
431                    java.util.Map<java.util.Locale, java.lang.String> titleMap) {
432                    _pollsQuestion.setTitleMap(titleMap);
433            }
434    
435            /**
436            * Sets the localized titles of this polls question from the map of locales and localized titles, and sets the default locale.
437            *
438            * @param titleMap the locales and localized titles of this polls question
439            * @param defaultLocale the default locale
440            */
441            public void setTitleMap(
442                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
443                    java.util.Locale defaultLocale) {
444                    _pollsQuestion.setTitleMap(titleMap, defaultLocale);
445            }
446    
447            /**
448            * Returns the description of this polls question.
449            *
450            * @return the description of this polls question
451            */
452            public java.lang.String getDescription() {
453                    return _pollsQuestion.getDescription();
454            }
455    
456            /**
457            * Returns the localized description of this polls question in the language. Uses the default language if no localization exists for the requested language.
458            *
459            * @param locale the locale of the language
460            * @return the localized description of this polls question
461            */
462            public java.lang.String getDescription(java.util.Locale locale) {
463                    return _pollsQuestion.getDescription(locale);
464            }
465    
466            /**
467            * Returns the localized description of this polls question in the language, optionally using the default language if no localization exists for the requested language.
468            *
469            * @param locale the local of the language
470            * @param useDefault whether to use the default language if no localization exists for the requested language
471            * @return the localized description of this polls question. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
472            */
473            public java.lang.String getDescription(java.util.Locale locale,
474                    boolean useDefault) {
475                    return _pollsQuestion.getDescription(locale, useDefault);
476            }
477    
478            /**
479            * Returns the localized description of this polls question in the language. Uses the default language if no localization exists for the requested language.
480            *
481            * @param languageId the ID of the language
482            * @return the localized description of this polls question
483            */
484            public java.lang.String getDescription(java.lang.String languageId) {
485                    return _pollsQuestion.getDescription(languageId);
486            }
487    
488            /**
489            * Returns the localized description of this polls question in the language, optionally using the default language if no localization exists for the requested language.
490            *
491            * @param languageId the ID of the language
492            * @param useDefault whether to use the default language if no localization exists for the requested language
493            * @return the localized description of this polls question
494            */
495            public java.lang.String getDescription(java.lang.String languageId,
496                    boolean useDefault) {
497                    return _pollsQuestion.getDescription(languageId, useDefault);
498            }
499    
500            public java.lang.String getDescriptionCurrentLanguageId() {
501                    return _pollsQuestion.getDescriptionCurrentLanguageId();
502            }
503    
504            public java.lang.String getDescriptionCurrentValue() {
505                    return _pollsQuestion.getDescriptionCurrentValue();
506            }
507    
508            /**
509            * Returns a map of the locales and localized descriptions of this polls question.
510            *
511            * @return the locales and localized descriptions of this polls question
512            */
513            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
514                    return _pollsQuestion.getDescriptionMap();
515            }
516    
517            /**
518            * Sets the description of this polls question.
519            *
520            * @param description the description of this polls question
521            */
522            public void setDescription(java.lang.String description) {
523                    _pollsQuestion.setDescription(description);
524            }
525    
526            /**
527            * Sets the localized description of this polls question in the language.
528            *
529            * @param description the localized description of this polls question
530            * @param locale the locale of the language
531            */
532            public void setDescription(java.lang.String description,
533                    java.util.Locale locale) {
534                    _pollsQuestion.setDescription(description, locale);
535            }
536    
537            /**
538            * Sets the localized description of this polls question in the language, and sets the default locale.
539            *
540            * @param description the localized description of this polls question
541            * @param locale the locale of the language
542            * @param defaultLocale the default locale
543            */
544            public void setDescription(java.lang.String description,
545                    java.util.Locale locale, java.util.Locale defaultLocale) {
546                    _pollsQuestion.setDescription(description, locale, defaultLocale);
547            }
548    
549            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
550                    _pollsQuestion.setDescriptionCurrentLanguageId(languageId);
551            }
552    
553            /**
554            * Sets the localized descriptions of this polls question from the map of locales and localized descriptions.
555            *
556            * @param descriptionMap the locales and localized descriptions of this polls question
557            */
558            public void setDescriptionMap(
559                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
560                    _pollsQuestion.setDescriptionMap(descriptionMap);
561            }
562    
563            /**
564            * Sets the localized descriptions of this polls question from the map of locales and localized descriptions, and sets the default locale.
565            *
566            * @param descriptionMap the locales and localized descriptions of this polls question
567            * @param defaultLocale the default locale
568            */
569            public void setDescriptionMap(
570                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
571                    java.util.Locale defaultLocale) {
572                    _pollsQuestion.setDescriptionMap(descriptionMap, defaultLocale);
573            }
574    
575            /**
576            * Returns the expiration date of this polls question.
577            *
578            * @return the expiration date of this polls question
579            */
580            public java.util.Date getExpirationDate() {
581                    return _pollsQuestion.getExpirationDate();
582            }
583    
584            /**
585            * Sets the expiration date of this polls question.
586            *
587            * @param expirationDate the expiration date of this polls question
588            */
589            public void setExpirationDate(java.util.Date expirationDate) {
590                    _pollsQuestion.setExpirationDate(expirationDate);
591            }
592    
593            /**
594            * Returns the last vote date of this polls question.
595            *
596            * @return the last vote date of this polls question
597            */
598            public java.util.Date getLastVoteDate() {
599                    return _pollsQuestion.getLastVoteDate();
600            }
601    
602            /**
603            * Sets the last vote date of this polls question.
604            *
605            * @param lastVoteDate the last vote date of this polls question
606            */
607            public void setLastVoteDate(java.util.Date lastVoteDate) {
608                    _pollsQuestion.setLastVoteDate(lastVoteDate);
609            }
610    
611            public boolean isNew() {
612                    return _pollsQuestion.isNew();
613            }
614    
615            public void setNew(boolean n) {
616                    _pollsQuestion.setNew(n);
617            }
618    
619            public boolean isCachedModel() {
620                    return _pollsQuestion.isCachedModel();
621            }
622    
623            public void setCachedModel(boolean cachedModel) {
624                    _pollsQuestion.setCachedModel(cachedModel);
625            }
626    
627            public boolean isEscapedModel() {
628                    return _pollsQuestion.isEscapedModel();
629            }
630    
631            public java.io.Serializable getPrimaryKeyObj() {
632                    return _pollsQuestion.getPrimaryKeyObj();
633            }
634    
635            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
636                    _pollsQuestion.setPrimaryKeyObj(primaryKeyObj);
637            }
638    
639            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
640                    return _pollsQuestion.getExpandoBridge();
641            }
642    
643            public void setExpandoBridgeAttributes(
644                    com.liferay.portal.model.BaseModel<?> baseModel) {
645                    _pollsQuestion.setExpandoBridgeAttributes(baseModel);
646            }
647    
648            public void setExpandoBridgeAttributes(
649                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
650                    _pollsQuestion.setExpandoBridgeAttributes(expandoBridge);
651            }
652    
653            public void setExpandoBridgeAttributes(
654                    com.liferay.portal.service.ServiceContext serviceContext) {
655                    _pollsQuestion.setExpandoBridgeAttributes(serviceContext);
656            }
657    
658            public void prepareLocalizedFieldsForImport(
659                    java.util.Locale defaultImportLocale)
660                    throws com.liferay.portal.LocaleException {
661                    _pollsQuestion.prepareLocalizedFieldsForImport(defaultImportLocale);
662            }
663    
664            @Override
665            public java.lang.Object clone() {
666                    return new PollsQuestionWrapper((PollsQuestion)_pollsQuestion.clone());
667            }
668    
669            public int compareTo(
670                    com.liferay.portlet.polls.model.PollsQuestion pollsQuestion) {
671                    return _pollsQuestion.compareTo(pollsQuestion);
672            }
673    
674            @Override
675            public int hashCode() {
676                    return _pollsQuestion.hashCode();
677            }
678    
679            public com.liferay.portal.model.CacheModel<com.liferay.portlet.polls.model.PollsQuestion> toCacheModel() {
680                    return _pollsQuestion.toCacheModel();
681            }
682    
683            public com.liferay.portlet.polls.model.PollsQuestion toEscapedModel() {
684                    return new PollsQuestionWrapper(_pollsQuestion.toEscapedModel());
685            }
686    
687            public com.liferay.portlet.polls.model.PollsQuestion toUnescapedModel() {
688                    return new PollsQuestionWrapper(_pollsQuestion.toUnescapedModel());
689            }
690    
691            @Override
692            public java.lang.String toString() {
693                    return _pollsQuestion.toString();
694            }
695    
696            public java.lang.String toXmlString() {
697                    return _pollsQuestion.toXmlString();
698            }
699    
700            public void persist()
701                    throws com.liferay.portal.kernel.exception.SystemException {
702                    _pollsQuestion.persist();
703            }
704    
705            public java.util.List<com.liferay.portlet.polls.model.PollsChoice> getChoices()
706                    throws com.liferay.portal.kernel.exception.SystemException {
707                    return _pollsQuestion.getChoices();
708            }
709    
710            public int getVotesCount()
711                    throws com.liferay.portal.kernel.exception.SystemException {
712                    return _pollsQuestion.getVotesCount();
713            }
714    
715            public boolean isExpired() {
716                    return _pollsQuestion.isExpired();
717            }
718    
719            public boolean isExpired(
720                    com.liferay.portal.service.ServiceContext serviceContext,
721                    java.util.Date defaultCreateDate) {
722                    return _pollsQuestion.isExpired(serviceContext, defaultCreateDate);
723            }
724    
725            /**
726             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
727             */
728            public PollsQuestion getWrappedPollsQuestion() {
729                    return _pollsQuestion;
730            }
731    
732            public PollsQuestion getWrappedModel() {
733                    return _pollsQuestion;
734            }
735    
736            public void resetOriginalValues() {
737                    _pollsQuestion.resetOriginalValues();
738            }
739    
740            private PollsQuestion _pollsQuestion;
741    }