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