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