001
014
015 package com.liferay.portlet.announcements.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.announcements.model.AnnouncementsEntry;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class AnnouncementsEntryCacheModel implements CacheModel<AnnouncementsEntry>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(35);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", entryId=");
043 sb.append(entryId);
044 sb.append(", companyId=");
045 sb.append(companyId);
046 sb.append(", userId=");
047 sb.append(userId);
048 sb.append(", userName=");
049 sb.append(userName);
050 sb.append(", createDate=");
051 sb.append(createDate);
052 sb.append(", modifiedDate=");
053 sb.append(modifiedDate);
054 sb.append(", classNameId=");
055 sb.append(classNameId);
056 sb.append(", classPK=");
057 sb.append(classPK);
058 sb.append(", title=");
059 sb.append(title);
060 sb.append(", content=");
061 sb.append(content);
062 sb.append(", url=");
063 sb.append(url);
064 sb.append(", type=");
065 sb.append(type);
066 sb.append(", displayDate=");
067 sb.append(displayDate);
068 sb.append(", expirationDate=");
069 sb.append(expirationDate);
070 sb.append(", priority=");
071 sb.append(priority);
072 sb.append(", alert=");
073 sb.append(alert);
074 sb.append("}");
075
076 return sb.toString();
077 }
078
079 public AnnouncementsEntry toEntityModel() {
080 AnnouncementsEntryImpl announcementsEntryImpl = new AnnouncementsEntryImpl();
081
082 if (uuid == null) {
083 announcementsEntryImpl.setUuid(StringPool.BLANK);
084 }
085 else {
086 announcementsEntryImpl.setUuid(uuid);
087 }
088
089 announcementsEntryImpl.setEntryId(entryId);
090 announcementsEntryImpl.setCompanyId(companyId);
091 announcementsEntryImpl.setUserId(userId);
092
093 if (userName == null) {
094 announcementsEntryImpl.setUserName(StringPool.BLANK);
095 }
096 else {
097 announcementsEntryImpl.setUserName(userName);
098 }
099
100 if (createDate == Long.MIN_VALUE) {
101 announcementsEntryImpl.setCreateDate(null);
102 }
103 else {
104 announcementsEntryImpl.setCreateDate(new Date(createDate));
105 }
106
107 if (modifiedDate == Long.MIN_VALUE) {
108 announcementsEntryImpl.setModifiedDate(null);
109 }
110 else {
111 announcementsEntryImpl.setModifiedDate(new Date(modifiedDate));
112 }
113
114 announcementsEntryImpl.setClassNameId(classNameId);
115 announcementsEntryImpl.setClassPK(classPK);
116
117 if (title == null) {
118 announcementsEntryImpl.setTitle(StringPool.BLANK);
119 }
120 else {
121 announcementsEntryImpl.setTitle(title);
122 }
123
124 if (content == null) {
125 announcementsEntryImpl.setContent(StringPool.BLANK);
126 }
127 else {
128 announcementsEntryImpl.setContent(content);
129 }
130
131 if (url == null) {
132 announcementsEntryImpl.setUrl(StringPool.BLANK);
133 }
134 else {
135 announcementsEntryImpl.setUrl(url);
136 }
137
138 if (type == null) {
139 announcementsEntryImpl.setType(StringPool.BLANK);
140 }
141 else {
142 announcementsEntryImpl.setType(type);
143 }
144
145 if (displayDate == Long.MIN_VALUE) {
146 announcementsEntryImpl.setDisplayDate(null);
147 }
148 else {
149 announcementsEntryImpl.setDisplayDate(new Date(displayDate));
150 }
151
152 if (expirationDate == Long.MIN_VALUE) {
153 announcementsEntryImpl.setExpirationDate(null);
154 }
155 else {
156 announcementsEntryImpl.setExpirationDate(new Date(expirationDate));
157 }
158
159 announcementsEntryImpl.setPriority(priority);
160 announcementsEntryImpl.setAlert(alert);
161
162 announcementsEntryImpl.resetOriginalValues();
163
164 return announcementsEntryImpl;
165 }
166
167 public String uuid;
168 public long entryId;
169 public long companyId;
170 public long userId;
171 public String userName;
172 public long createDate;
173 public long modifiedDate;
174 public long classNameId;
175 public long classPK;
176 public String title;
177 public String content;
178 public String url;
179 public String type;
180 public long displayDate;
181 public long expirationDate;
182 public int priority;
183 public boolean alert;
184 }