001
014
015 package com.liferay.portlet.announcements.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.model.CacheModel;
019
020 import com.liferay.portlet.announcements.model.AnnouncementsFlag;
021
022 import java.io.Serializable;
023
024 import java.util.Date;
025
026
033 public class AnnouncementsFlagCacheModel implements CacheModel<AnnouncementsFlag>,
034 Serializable {
035 @Override
036 public String toString() {
037 StringBundler sb = new StringBundler(11);
038
039 sb.append("{flagId=");
040 sb.append(flagId);
041 sb.append(", userId=");
042 sb.append(userId);
043 sb.append(", createDate=");
044 sb.append(createDate);
045 sb.append(", entryId=");
046 sb.append(entryId);
047 sb.append(", value=");
048 sb.append(value);
049 sb.append("}");
050
051 return sb.toString();
052 }
053
054 public AnnouncementsFlag toEntityModel() {
055 AnnouncementsFlagImpl announcementsFlagImpl = new AnnouncementsFlagImpl();
056
057 announcementsFlagImpl.setFlagId(flagId);
058 announcementsFlagImpl.setUserId(userId);
059
060 if (createDate == Long.MIN_VALUE) {
061 announcementsFlagImpl.setCreateDate(null);
062 }
063 else {
064 announcementsFlagImpl.setCreateDate(new Date(createDate));
065 }
066
067 announcementsFlagImpl.setEntryId(entryId);
068 announcementsFlagImpl.setValue(value);
069
070 announcementsFlagImpl.resetOriginalValues();
071
072 return announcementsFlagImpl;
073 }
074
075 public long flagId;
076 public long userId;
077 public long createDate;
078 public long entryId;
079 public int value;
080 }