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