001
014
015 package com.liferay.portlet.polls.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.StringPool;
019 import com.liferay.portal.model.CacheModel;
020
021 import com.liferay.portlet.polls.model.PollsChoice;
022
023 import java.io.Serializable;
024
025
032 public class PollsChoiceCacheModel implements CacheModel<PollsChoice>,
033 Serializable {
034 @Override
035 public String toString() {
036 StringBundler sb = new StringBundler(11);
037
038 sb.append("{uuid=");
039 sb.append(uuid);
040 sb.append(", choiceId=");
041 sb.append(choiceId);
042 sb.append(", questionId=");
043 sb.append(questionId);
044 sb.append(", name=");
045 sb.append(name);
046 sb.append(", description=");
047 sb.append(description);
048 sb.append("}");
049
050 return sb.toString();
051 }
052
053 public PollsChoice toEntityModel() {
054 PollsChoiceImpl pollsChoiceImpl = new PollsChoiceImpl();
055
056 if (uuid == null) {
057 pollsChoiceImpl.setUuid(StringPool.BLANK);
058 }
059 else {
060 pollsChoiceImpl.setUuid(uuid);
061 }
062
063 pollsChoiceImpl.setChoiceId(choiceId);
064 pollsChoiceImpl.setQuestionId(questionId);
065
066 if (name == null) {
067 pollsChoiceImpl.setName(StringPool.BLANK);
068 }
069 else {
070 pollsChoiceImpl.setName(name);
071 }
072
073 if (description == null) {
074 pollsChoiceImpl.setDescription(StringPool.BLANK);
075 }
076 else {
077 pollsChoiceImpl.setDescription(description);
078 }
079
080 pollsChoiceImpl.resetOriginalValues();
081
082 return pollsChoiceImpl;
083 }
084
085 public String uuid;
086 public long choiceId;
087 public long questionId;
088 public String name;
089 public String description;
090 }