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.DLSync;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class DLSyncCacheModel implements CacheModel<DLSync>, Serializable {
035 @Override
036 public String toString() {
037 StringBundler sb = new StringBundler(27);
038
039 sb.append("{syncId=");
040 sb.append(syncId);
041 sb.append(", companyId=");
042 sb.append(companyId);
043 sb.append(", createDate=");
044 sb.append(createDate);
045 sb.append(", modifiedDate=");
046 sb.append(modifiedDate);
047 sb.append(", fileId=");
048 sb.append(fileId);
049 sb.append(", fileUuid=");
050 sb.append(fileUuid);
051 sb.append(", repositoryId=");
052 sb.append(repositoryId);
053 sb.append(", parentFolderId=");
054 sb.append(parentFolderId);
055 sb.append(", name=");
056 sb.append(name);
057 sb.append(", description=");
058 sb.append(description);
059 sb.append(", event=");
060 sb.append(event);
061 sb.append(", type=");
062 sb.append(type);
063 sb.append(", version=");
064 sb.append(version);
065 sb.append("}");
066
067 return sb.toString();
068 }
069
070 public DLSync toEntityModel() {
071 DLSyncImpl dlSyncImpl = new DLSyncImpl();
072
073 dlSyncImpl.setSyncId(syncId);
074 dlSyncImpl.setCompanyId(companyId);
075
076 if (createDate == Long.MIN_VALUE) {
077 dlSyncImpl.setCreateDate(null);
078 }
079 else {
080 dlSyncImpl.setCreateDate(new Date(createDate));
081 }
082
083 if (modifiedDate == Long.MIN_VALUE) {
084 dlSyncImpl.setModifiedDate(null);
085 }
086 else {
087 dlSyncImpl.setModifiedDate(new Date(modifiedDate));
088 }
089
090 dlSyncImpl.setFileId(fileId);
091
092 if (fileUuid == null) {
093 dlSyncImpl.setFileUuid(StringPool.BLANK);
094 }
095 else {
096 dlSyncImpl.setFileUuid(fileUuid);
097 }
098
099 dlSyncImpl.setRepositoryId(repositoryId);
100 dlSyncImpl.setParentFolderId(parentFolderId);
101
102 if (name == null) {
103 dlSyncImpl.setName(StringPool.BLANK);
104 }
105 else {
106 dlSyncImpl.setName(name);
107 }
108
109 if (description == null) {
110 dlSyncImpl.setDescription(StringPool.BLANK);
111 }
112 else {
113 dlSyncImpl.setDescription(description);
114 }
115
116 if (event == null) {
117 dlSyncImpl.setEvent(StringPool.BLANK);
118 }
119 else {
120 dlSyncImpl.setEvent(event);
121 }
122
123 if (type == null) {
124 dlSyncImpl.setType(StringPool.BLANK);
125 }
126 else {
127 dlSyncImpl.setType(type);
128 }
129
130 if (version == null) {
131 dlSyncImpl.setVersion(StringPool.BLANK);
132 }
133 else {
134 dlSyncImpl.setVersion(version);
135 }
136
137 dlSyncImpl.resetOriginalValues();
138
139 return dlSyncImpl;
140 }
141
142 public long syncId;
143 public long companyId;
144 public long createDate;
145 public long modifiedDate;
146 public long fileId;
147 public String fileUuid;
148 public long repositoryId;
149 public long parentFolderId;
150 public String name;
151 public String description;
152 public String event;
153 public String type;
154 public String version;
155 }