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