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