001    /**
002     * Copyright (c) 2000-2012 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.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link PollsChoice}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       PollsChoice
029     * @generated
030     */
031    public class PollsChoiceWrapper implements PollsChoice,
032            ModelWrapper<PollsChoice> {
033            public PollsChoiceWrapper(PollsChoice pollsChoice) {
034                    _pollsChoice = pollsChoice;
035            }
036    
037            public Class<?> getModelClass() {
038                    return PollsChoice.class;
039            }
040    
041            public String getModelClassName() {
042                    return PollsChoice.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("uuid", getUuid());
049                    attributes.put("choiceId", getChoiceId());
050                    attributes.put("questionId", getQuestionId());
051                    attributes.put("name", getName());
052                    attributes.put("description", getDescription());
053    
054                    return attributes;
055            }
056    
057            public void setModelAttributes(Map<String, Object> attributes) {
058                    String uuid = (String)attributes.get("uuid");
059    
060                    if (uuid != null) {
061                            setUuid(uuid);
062                    }
063    
064                    Long choiceId = (Long)attributes.get("choiceId");
065    
066                    if (choiceId != null) {
067                            setChoiceId(choiceId);
068                    }
069    
070                    Long questionId = (Long)attributes.get("questionId");
071    
072                    if (questionId != null) {
073                            setQuestionId(questionId);
074                    }
075    
076                    String name = (String)attributes.get("name");
077    
078                    if (name != null) {
079                            setName(name);
080                    }
081    
082                    String description = (String)attributes.get("description");
083    
084                    if (description != null) {
085                            setDescription(description);
086                    }
087            }
088    
089            /**
090            * Returns the primary key of this polls choice.
091            *
092            * @return the primary key of this polls choice
093            */
094            public long getPrimaryKey() {
095                    return _pollsChoice.getPrimaryKey();
096            }
097    
098            /**
099            * Sets the primary key of this polls choice.
100            *
101            * @param primaryKey the primary key of this polls choice
102            */
103            public void setPrimaryKey(long primaryKey) {
104                    _pollsChoice.setPrimaryKey(primaryKey);
105            }
106    
107            /**
108            * Returns the uuid of this polls choice.
109            *
110            * @return the uuid of this polls choice
111            */
112            public java.lang.String getUuid() {
113                    return _pollsChoice.getUuid();
114            }
115    
116            /**
117            * Sets the uuid of this polls choice.
118            *
119            * @param uuid the uuid of this polls choice
120            */
121            public void setUuid(java.lang.String uuid) {
122                    _pollsChoice.setUuid(uuid);
123            }
124    
125            /**
126            * Returns the choice ID of this polls choice.
127            *
128            * @return the choice ID of this polls choice
129            */
130            public long getChoiceId() {
131                    return _pollsChoice.getChoiceId();
132            }
133    
134            /**
135            * Sets the choice ID of this polls choice.
136            *
137            * @param choiceId the choice ID of this polls choice
138            */
139            public void setChoiceId(long choiceId) {
140                    _pollsChoice.setChoiceId(choiceId);
141            }
142    
143            /**
144            * Returns the question ID of this polls choice.
145            *
146            * @return the question ID of this polls choice
147            */
148            public long getQuestionId() {
149                    return _pollsChoice.getQuestionId();
150            }
151    
152            /**
153            * Sets the question ID of this polls choice.
154            *
155            * @param questionId the question ID of this polls choice
156            */
157            public void setQuestionId(long questionId) {
158                    _pollsChoice.setQuestionId(questionId);
159            }
160    
161            /**
162            * Returns the name of this polls choice.
163            *
164            * @return the name of this polls choice
165            */
166            public java.lang.String getName() {
167                    return _pollsChoice.getName();
168            }
169    
170            /**
171            * Sets the name of this polls choice.
172            *
173            * @param name the name of this polls choice
174            */
175            public void setName(java.lang.String name) {
176                    _pollsChoice.setName(name);
177            }
178    
179            /**
180            * Returns the description of this polls choice.
181            *
182            * @return the description of this polls choice
183            */
184            public java.lang.String getDescription() {
185                    return _pollsChoice.getDescription();
186            }
187    
188            /**
189            * Returns the localized description of this polls choice in the language. Uses the default language if no localization exists for the requested language.
190            *
191            * @param locale the locale of the language
192            * @return the localized description of this polls choice
193            */
194            public java.lang.String getDescription(java.util.Locale locale) {
195                    return _pollsChoice.getDescription(locale);
196            }
197    
198            /**
199            * Returns the localized description of this polls choice in the language, optionally using the default language if no localization exists for the requested language.
200            *
201            * @param locale the local of the language
202            * @param useDefault whether to use the default language if no localization exists for the requested language
203            * @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.
204            */
205            public java.lang.String getDescription(java.util.Locale locale,
206                    boolean useDefault) {
207                    return _pollsChoice.getDescription(locale, useDefault);
208            }
209    
210            /**
211            * Returns the localized description of this polls choice in the language. Uses the default language if no localization exists for the requested language.
212            *
213            * @param languageId the ID of the language
214            * @return the localized description of this polls choice
215            */
216            public java.lang.String getDescription(java.lang.String languageId) {
217                    return _pollsChoice.getDescription(languageId);
218            }
219    
220            /**
221            * Returns the localized description of this polls choice in the language, optionally using the default language if no localization exists for the requested language.
222            *
223            * @param languageId the ID of the language
224            * @param useDefault whether to use the default language if no localization exists for the requested language
225            * @return the localized description of this polls choice
226            */
227            public java.lang.String getDescription(java.lang.String languageId,
228                    boolean useDefault) {
229                    return _pollsChoice.getDescription(languageId, useDefault);
230            }
231    
232            public java.lang.String getDescriptionCurrentLanguageId() {
233                    return _pollsChoice.getDescriptionCurrentLanguageId();
234            }
235    
236            public java.lang.String getDescriptionCurrentValue() {
237                    return _pollsChoice.getDescriptionCurrentValue();
238            }
239    
240            /**
241            * Returns a map of the locales and localized descriptions of this polls choice.
242            *
243            * @return the locales and localized descriptions of this polls choice
244            */
245            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
246                    return _pollsChoice.getDescriptionMap();
247            }
248    
249            /**
250            * Sets the description of this polls choice.
251            *
252            * @param description the description of this polls choice
253            */
254            public void setDescription(java.lang.String description) {
255                    _pollsChoice.setDescription(description);
256            }
257    
258            /**
259            * Sets the localized description of this polls choice in the language.
260            *
261            * @param description the localized description of this polls choice
262            * @param locale the locale of the language
263            */
264            public void setDescription(java.lang.String description,
265                    java.util.Locale locale) {
266                    _pollsChoice.setDescription(description, locale);
267            }
268    
269            /**
270            * Sets the localized description of this polls choice in the language, and sets the default locale.
271            *
272            * @param description the localized description of this polls choice
273            * @param locale the locale of the language
274            * @param defaultLocale the default locale
275            */
276            public void setDescription(java.lang.String description,
277                    java.util.Locale locale, java.util.Locale defaultLocale) {
278                    _pollsChoice.setDescription(description, locale, defaultLocale);
279            }
280    
281            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
282                    _pollsChoice.setDescriptionCurrentLanguageId(languageId);
283            }
284    
285            /**
286            * Sets the localized descriptions of this polls choice from the map of locales and localized descriptions.
287            *
288            * @param descriptionMap the locales and localized descriptions of this polls choice
289            */
290            public void setDescriptionMap(
291                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
292                    _pollsChoice.setDescriptionMap(descriptionMap);
293            }
294    
295            /**
296            * Sets the localized descriptions of this polls choice from the map of locales and localized descriptions, and sets the default locale.
297            *
298            * @param descriptionMap the locales and localized descriptions of this polls choice
299            * @param defaultLocale the default locale
300            */
301            public void setDescriptionMap(
302                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
303                    java.util.Locale defaultLocale) {
304                    _pollsChoice.setDescriptionMap(descriptionMap, defaultLocale);
305            }
306    
307            public boolean isNew() {
308                    return _pollsChoice.isNew();
309            }
310    
311            public void setNew(boolean n) {
312                    _pollsChoice.setNew(n);
313            }
314    
315            public boolean isCachedModel() {
316                    return _pollsChoice.isCachedModel();
317            }
318    
319            public void setCachedModel(boolean cachedModel) {
320                    _pollsChoice.setCachedModel(cachedModel);
321            }
322    
323            public boolean isEscapedModel() {
324                    return _pollsChoice.isEscapedModel();
325            }
326    
327            public java.io.Serializable getPrimaryKeyObj() {
328                    return _pollsChoice.getPrimaryKeyObj();
329            }
330    
331            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
332                    _pollsChoice.setPrimaryKeyObj(primaryKeyObj);
333            }
334    
335            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
336                    return _pollsChoice.getExpandoBridge();
337            }
338    
339            public void setExpandoBridgeAttributes(
340                    com.liferay.portal.service.ServiceContext serviceContext) {
341                    _pollsChoice.setExpandoBridgeAttributes(serviceContext);
342            }
343    
344            public void prepareLocalizedFieldsForImport(
345                    java.util.Locale defaultImportLocale)
346                    throws com.liferay.portal.LocaleException {
347                    _pollsChoice.prepareLocalizedFieldsForImport(defaultImportLocale);
348            }
349    
350            @Override
351            public java.lang.Object clone() {
352                    return new PollsChoiceWrapper((PollsChoice)_pollsChoice.clone());
353            }
354    
355            public int compareTo(
356                    com.liferay.portlet.polls.model.PollsChoice pollsChoice) {
357                    return _pollsChoice.compareTo(pollsChoice);
358            }
359    
360            @Override
361            public int hashCode() {
362                    return _pollsChoice.hashCode();
363            }
364    
365            public com.liferay.portal.model.CacheModel<com.liferay.portlet.polls.model.PollsChoice> toCacheModel() {
366                    return _pollsChoice.toCacheModel();
367            }
368    
369            public com.liferay.portlet.polls.model.PollsChoice toEscapedModel() {
370                    return new PollsChoiceWrapper(_pollsChoice.toEscapedModel());
371            }
372    
373            @Override
374            public java.lang.String toString() {
375                    return _pollsChoice.toString();
376            }
377    
378            public java.lang.String toXmlString() {
379                    return _pollsChoice.toXmlString();
380            }
381    
382            public void persist()
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    _pollsChoice.persist();
385            }
386    
387            public int getVotesCount()
388                    throws com.liferay.portal.kernel.exception.SystemException {
389                    return _pollsChoice.getVotesCount();
390            }
391    
392            /**
393             * @deprecated Renamed to {@link #getWrappedModel}
394             */
395            public PollsChoice getWrappedPollsChoice() {
396                    return _pollsChoice;
397            }
398    
399            public PollsChoice getWrappedModel() {
400                    return _pollsChoice;
401            }
402    
403            public void resetOriginalValues() {
404                    _pollsChoice.resetOriginalValues();
405            }
406    
407            private PollsChoice _pollsChoice;
408    }