001
014
015 package com.liferay.portlet.bookmarks.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.bookmarks.model.BookmarksFolder;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class BookmarksFolderCacheModel implements CacheModel<BookmarksFolder>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(25);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", folderId=");
043 sb.append(folderId);
044 sb.append(", groupId=");
045 sb.append(groupId);
046 sb.append(", companyId=");
047 sb.append(companyId);
048 sb.append(", userId=");
049 sb.append(userId);
050 sb.append(", userName=");
051 sb.append(userName);
052 sb.append(", createDate=");
053 sb.append(createDate);
054 sb.append(", modifiedDate=");
055 sb.append(modifiedDate);
056 sb.append(", resourceBlockId=");
057 sb.append(resourceBlockId);
058 sb.append(", parentFolderId=");
059 sb.append(parentFolderId);
060 sb.append(", name=");
061 sb.append(name);
062 sb.append(", description=");
063 sb.append(description);
064 sb.append("}");
065
066 return sb.toString();
067 }
068
069 public BookmarksFolder toEntityModel() {
070 BookmarksFolderImpl bookmarksFolderImpl = new BookmarksFolderImpl();
071
072 if (uuid == null) {
073 bookmarksFolderImpl.setUuid(StringPool.BLANK);
074 }
075 else {
076 bookmarksFolderImpl.setUuid(uuid);
077 }
078
079 bookmarksFolderImpl.setFolderId(folderId);
080 bookmarksFolderImpl.setGroupId(groupId);
081 bookmarksFolderImpl.setCompanyId(companyId);
082 bookmarksFolderImpl.setUserId(userId);
083
084 if (userName == null) {
085 bookmarksFolderImpl.setUserName(StringPool.BLANK);
086 }
087 else {
088 bookmarksFolderImpl.setUserName(userName);
089 }
090
091 if (createDate == Long.MIN_VALUE) {
092 bookmarksFolderImpl.setCreateDate(null);
093 }
094 else {
095 bookmarksFolderImpl.setCreateDate(new Date(createDate));
096 }
097
098 if (modifiedDate == Long.MIN_VALUE) {
099 bookmarksFolderImpl.setModifiedDate(null);
100 }
101 else {
102 bookmarksFolderImpl.setModifiedDate(new Date(modifiedDate));
103 }
104
105 bookmarksFolderImpl.setResourceBlockId(resourceBlockId);
106 bookmarksFolderImpl.setParentFolderId(parentFolderId);
107
108 if (name == null) {
109 bookmarksFolderImpl.setName(StringPool.BLANK);
110 }
111 else {
112 bookmarksFolderImpl.setName(name);
113 }
114
115 if (description == null) {
116 bookmarksFolderImpl.setDescription(StringPool.BLANK);
117 }
118 else {
119 bookmarksFolderImpl.setDescription(description);
120 }
121
122 bookmarksFolderImpl.resetOriginalValues();
123
124 return bookmarksFolderImpl;
125 }
126
127 public String uuid;
128 public long folderId;
129 public long groupId;
130 public long companyId;
131 public long userId;
132 public String userName;
133 public long createDate;
134 public long modifiedDate;
135 public long resourceBlockId;
136 public long parentFolderId;
137 public String name;
138 public String description;
139 }