001
014
015 package com.liferay.portlet.journal.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.journal.model.JournalStructure;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class JournalStructureCacheModel implements CacheModel<JournalStructure>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(27);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", id=");
043 sb.append(id);
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(", structureId=");
057 sb.append(structureId);
058 sb.append(", parentStructureId=");
059 sb.append(parentStructureId);
060 sb.append(", name=");
061 sb.append(name);
062 sb.append(", description=");
063 sb.append(description);
064 sb.append(", xsd=");
065 sb.append(xsd);
066 sb.append("}");
067
068 return sb.toString();
069 }
070
071 public JournalStructure toEntityModel() {
072 JournalStructureImpl journalStructureImpl = new JournalStructureImpl();
073
074 if (uuid == null) {
075 journalStructureImpl.setUuid(StringPool.BLANK);
076 }
077 else {
078 journalStructureImpl.setUuid(uuid);
079 }
080
081 journalStructureImpl.setId(id);
082 journalStructureImpl.setGroupId(groupId);
083 journalStructureImpl.setCompanyId(companyId);
084 journalStructureImpl.setUserId(userId);
085
086 if (userName == null) {
087 journalStructureImpl.setUserName(StringPool.BLANK);
088 }
089 else {
090 journalStructureImpl.setUserName(userName);
091 }
092
093 if (createDate == Long.MIN_VALUE) {
094 journalStructureImpl.setCreateDate(null);
095 }
096 else {
097 journalStructureImpl.setCreateDate(new Date(createDate));
098 }
099
100 if (modifiedDate == Long.MIN_VALUE) {
101 journalStructureImpl.setModifiedDate(null);
102 }
103 else {
104 journalStructureImpl.setModifiedDate(new Date(modifiedDate));
105 }
106
107 if (structureId == null) {
108 journalStructureImpl.setStructureId(StringPool.BLANK);
109 }
110 else {
111 journalStructureImpl.setStructureId(structureId);
112 }
113
114 if (parentStructureId == null) {
115 journalStructureImpl.setParentStructureId(StringPool.BLANK);
116 }
117 else {
118 journalStructureImpl.setParentStructureId(parentStructureId);
119 }
120
121 if (name == null) {
122 journalStructureImpl.setName(StringPool.BLANK);
123 }
124 else {
125 journalStructureImpl.setName(name);
126 }
127
128 if (description == null) {
129 journalStructureImpl.setDescription(StringPool.BLANK);
130 }
131 else {
132 journalStructureImpl.setDescription(description);
133 }
134
135 if (xsd == null) {
136 journalStructureImpl.setXsd(StringPool.BLANK);
137 }
138 else {
139 journalStructureImpl.setXsd(xsd);
140 }
141
142 journalStructureImpl.resetOriginalValues();
143
144 return journalStructureImpl;
145 }
146
147 public String uuid;
148 public long id;
149 public long groupId;
150 public long companyId;
151 public long userId;
152 public String userName;
153 public long createDate;
154 public long modifiedDate;
155 public String structureId;
156 public String parentStructureId;
157 public String name;
158 public String description;
159 public String xsd;
160 }