001
014
015 package com.liferay.portlet.softwarecatalog.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.softwarecatalog.model.SCProductEntry;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class SCProductEntryCacheModel implements CacheModel<SCProductEntry>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(33);
039
040 sb.append("{productEntryId=");
041 sb.append(productEntryId);
042 sb.append(", groupId=");
043 sb.append(groupId);
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(", name=");
055 sb.append(name);
056 sb.append(", type=");
057 sb.append(type);
058 sb.append(", tags=");
059 sb.append(tags);
060 sb.append(", shortDescription=");
061 sb.append(shortDescription);
062 sb.append(", longDescription=");
063 sb.append(longDescription);
064 sb.append(", pageURL=");
065 sb.append(pageURL);
066 sb.append(", author=");
067 sb.append(author);
068 sb.append(", repoGroupId=");
069 sb.append(repoGroupId);
070 sb.append(", repoArtifactId=");
071 sb.append(repoArtifactId);
072 sb.append("}");
073
074 return sb.toString();
075 }
076
077 public SCProductEntry toEntityModel() {
078 SCProductEntryImpl scProductEntryImpl = new SCProductEntryImpl();
079
080 scProductEntryImpl.setProductEntryId(productEntryId);
081 scProductEntryImpl.setGroupId(groupId);
082 scProductEntryImpl.setCompanyId(companyId);
083 scProductEntryImpl.setUserId(userId);
084
085 if (userName == null) {
086 scProductEntryImpl.setUserName(StringPool.BLANK);
087 }
088 else {
089 scProductEntryImpl.setUserName(userName);
090 }
091
092 if (createDate == Long.MIN_VALUE) {
093 scProductEntryImpl.setCreateDate(null);
094 }
095 else {
096 scProductEntryImpl.setCreateDate(new Date(createDate));
097 }
098
099 if (modifiedDate == Long.MIN_VALUE) {
100 scProductEntryImpl.setModifiedDate(null);
101 }
102 else {
103 scProductEntryImpl.setModifiedDate(new Date(modifiedDate));
104 }
105
106 if (name == null) {
107 scProductEntryImpl.setName(StringPool.BLANK);
108 }
109 else {
110 scProductEntryImpl.setName(name);
111 }
112
113 if (type == null) {
114 scProductEntryImpl.setType(StringPool.BLANK);
115 }
116 else {
117 scProductEntryImpl.setType(type);
118 }
119
120 if (tags == null) {
121 scProductEntryImpl.setTags(StringPool.BLANK);
122 }
123 else {
124 scProductEntryImpl.setTags(tags);
125 }
126
127 if (shortDescription == null) {
128 scProductEntryImpl.setShortDescription(StringPool.BLANK);
129 }
130 else {
131 scProductEntryImpl.setShortDescription(shortDescription);
132 }
133
134 if (longDescription == null) {
135 scProductEntryImpl.setLongDescription(StringPool.BLANK);
136 }
137 else {
138 scProductEntryImpl.setLongDescription(longDescription);
139 }
140
141 if (pageURL == null) {
142 scProductEntryImpl.setPageURL(StringPool.BLANK);
143 }
144 else {
145 scProductEntryImpl.setPageURL(pageURL);
146 }
147
148 if (author == null) {
149 scProductEntryImpl.setAuthor(StringPool.BLANK);
150 }
151 else {
152 scProductEntryImpl.setAuthor(author);
153 }
154
155 if (repoGroupId == null) {
156 scProductEntryImpl.setRepoGroupId(StringPool.BLANK);
157 }
158 else {
159 scProductEntryImpl.setRepoGroupId(repoGroupId);
160 }
161
162 if (repoArtifactId == null) {
163 scProductEntryImpl.setRepoArtifactId(StringPool.BLANK);
164 }
165 else {
166 scProductEntryImpl.setRepoArtifactId(repoArtifactId);
167 }
168
169 scProductEntryImpl.resetOriginalValues();
170
171 return scProductEntryImpl;
172 }
173
174 public long productEntryId;
175 public long groupId;
176 public long companyId;
177 public long userId;
178 public String userName;
179 public long createDate;
180 public long modifiedDate;
181 public String name;
182 public String type;
183 public String tags;
184 public String shortDescription;
185 public String longDescription;
186 public String pageURL;
187 public String author;
188 public String repoGroupId;
189 public String repoArtifactId;
190 }