001
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.HashMap;
021 import java.util.Map;
022
023
032 public class PollsChoiceWrapper implements PollsChoice,
033 ModelWrapper<PollsChoice> {
034 public PollsChoiceWrapper(PollsChoice pollsChoice) {
035 _pollsChoice = pollsChoice;
036 }
037
038 public Class<?> getModelClass() {
039 return PollsChoice.class;
040 }
041
042 public String getModelClassName() {
043 return PollsChoice.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("uuid", getUuid());
050 attributes.put("choiceId", getChoiceId());
051 attributes.put("questionId", getQuestionId());
052 attributes.put("name", getName());
053 attributes.put("description", getDescription());
054
055 return attributes;
056 }
057
058 public void setModelAttributes(Map<String, Object> attributes) {
059 String uuid = (String)attributes.get("uuid");
060
061 if (uuid != null) {
062 setUuid(uuid);
063 }
064
065 Long choiceId = (Long)attributes.get("choiceId");
066
067 if (choiceId != null) {
068 setChoiceId(choiceId);
069 }
070
071 Long questionId = (Long)attributes.get("questionId");
072
073 if (questionId != null) {
074 setQuestionId(questionId);
075 }
076
077 String name = (String)attributes.get("name");
078
079 if (name != null) {
080 setName(name);
081 }
082
083 String description = (String)attributes.get("description");
084
085 if (description != null) {
086 setDescription(description);
087 }
088 }
089
090
095 public long getPrimaryKey() {
096 return _pollsChoice.getPrimaryKey();
097 }
098
099
104 public void setPrimaryKey(long primaryKey) {
105 _pollsChoice.setPrimaryKey(primaryKey);
106 }
107
108
113 public java.lang.String getUuid() {
114 return _pollsChoice.getUuid();
115 }
116
117
122 public void setUuid(java.lang.String uuid) {
123 _pollsChoice.setUuid(uuid);
124 }
125
126
131 public long getChoiceId() {
132 return _pollsChoice.getChoiceId();
133 }
134
135
140 public void setChoiceId(long choiceId) {
141 _pollsChoice.setChoiceId(choiceId);
142 }
143
144
149 public long getQuestionId() {
150 return _pollsChoice.getQuestionId();
151 }
152
153
158 public void setQuestionId(long questionId) {
159 _pollsChoice.setQuestionId(questionId);
160 }
161
162
167 public java.lang.String getName() {
168 return _pollsChoice.getName();
169 }
170
171
176 public void setName(java.lang.String name) {
177 _pollsChoice.setName(name);
178 }
179
180
185 public java.lang.String getDescription() {
186 return _pollsChoice.getDescription();
187 }
188
189
195 public java.lang.String getDescription(java.util.Locale locale) {
196 return _pollsChoice.getDescription(locale);
197 }
198
199
206 public java.lang.String getDescription(java.util.Locale locale,
207 boolean useDefault) {
208 return _pollsChoice.getDescription(locale, useDefault);
209 }
210
211
217 public java.lang.String getDescription(java.lang.String languageId) {
218 return _pollsChoice.getDescription(languageId);
219 }
220
221
228 public java.lang.String getDescription(java.lang.String languageId,
229 boolean useDefault) {
230 return _pollsChoice.getDescription(languageId, useDefault);
231 }
232
233 public java.lang.String getDescriptionCurrentLanguageId() {
234 return _pollsChoice.getDescriptionCurrentLanguageId();
235 }
236
237 public java.lang.String getDescriptionCurrentValue() {
238 return _pollsChoice.getDescriptionCurrentValue();
239 }
240
241
246 public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
247 return _pollsChoice.getDescriptionMap();
248 }
249
250
255 public void setDescription(java.lang.String description) {
256 _pollsChoice.setDescription(description);
257 }
258
259
265 public void setDescription(java.lang.String description,
266 java.util.Locale locale) {
267 _pollsChoice.setDescription(description, locale);
268 }
269
270
277 public void setDescription(java.lang.String description,
278 java.util.Locale locale, java.util.Locale defaultLocale) {
279 _pollsChoice.setDescription(description, locale, defaultLocale);
280 }
281
282 public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
283 _pollsChoice.setDescriptionCurrentLanguageId(languageId);
284 }
285
286
291 public void setDescriptionMap(
292 java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
293 _pollsChoice.setDescriptionMap(descriptionMap);
294 }
295
296
302 public void setDescriptionMap(
303 java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
304 java.util.Locale defaultLocale) {
305 _pollsChoice.setDescriptionMap(descriptionMap, defaultLocale);
306 }
307
308 public boolean isNew() {
309 return _pollsChoice.isNew();
310 }
311
312 public void setNew(boolean n) {
313 _pollsChoice.setNew(n);
314 }
315
316 public boolean isCachedModel() {
317 return _pollsChoice.isCachedModel();
318 }
319
320 public void setCachedModel(boolean cachedModel) {
321 _pollsChoice.setCachedModel(cachedModel);
322 }
323
324 public boolean isEscapedModel() {
325 return _pollsChoice.isEscapedModel();
326 }
327
328 public java.io.Serializable getPrimaryKeyObj() {
329 return _pollsChoice.getPrimaryKeyObj();
330 }
331
332 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
333 _pollsChoice.setPrimaryKeyObj(primaryKeyObj);
334 }
335
336 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
337 return _pollsChoice.getExpandoBridge();
338 }
339
340 public void setExpandoBridgeAttributes(
341 com.liferay.portal.service.ServiceContext serviceContext) {
342 _pollsChoice.setExpandoBridgeAttributes(serviceContext);
343 }
344
345 public void prepareLocalizedFieldsForImport(
346 java.util.Locale defaultImportLocale)
347 throws com.liferay.portal.LocaleException {
348 _pollsChoice.prepareLocalizedFieldsForImport(defaultImportLocale);
349 }
350
351 @Override
352 public java.lang.Object clone() {
353 return new PollsChoiceWrapper((PollsChoice)_pollsChoice.clone());
354 }
355
356 public int compareTo(
357 com.liferay.portlet.polls.model.PollsChoice pollsChoice) {
358 return _pollsChoice.compareTo(pollsChoice);
359 }
360
361 @Override
362 public int hashCode() {
363 return _pollsChoice.hashCode();
364 }
365
366 public com.liferay.portal.model.CacheModel<com.liferay.portlet.polls.model.PollsChoice> toCacheModel() {
367 return _pollsChoice.toCacheModel();
368 }
369
370 public com.liferay.portlet.polls.model.PollsChoice toEscapedModel() {
371 return new PollsChoiceWrapper(_pollsChoice.toEscapedModel());
372 }
373
374 public com.liferay.portlet.polls.model.PollsChoice toUnescapedModel() {
375 return new PollsChoiceWrapper(_pollsChoice.toUnescapedModel());
376 }
377
378 @Override
379 public java.lang.String toString() {
380 return _pollsChoice.toString();
381 }
382
383 public java.lang.String toXmlString() {
384 return _pollsChoice.toXmlString();
385 }
386
387 public void persist()
388 throws com.liferay.portal.kernel.exception.SystemException {
389 _pollsChoice.persist();
390 }
391
392 public int getVotesCount()
393 throws com.liferay.portal.kernel.exception.SystemException {
394 return _pollsChoice.getVotesCount();
395 }
396
397 @Override
398 public boolean equals(Object obj) {
399 if (this == obj) {
400 return true;
401 }
402
403 if (!(obj instanceof PollsChoiceWrapper)) {
404 return false;
405 }
406
407 PollsChoiceWrapper pollsChoiceWrapper = (PollsChoiceWrapper)obj;
408
409 if (Validator.equals(_pollsChoice, pollsChoiceWrapper._pollsChoice)) {
410 return true;
411 }
412
413 return false;
414 }
415
416
419 public PollsChoice getWrappedPollsChoice() {
420 return _pollsChoice;
421 }
422
423 public PollsChoice getWrappedModel() {
424 return _pollsChoice;
425 }
426
427 public void resetOriginalValues() {
428 _pollsChoice.resetOriginalValues();
429 }
430
431 private PollsChoice _pollsChoice;
432 }