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