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