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