001
014
015 package com.liferay.portlet.asset.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.asset.model.AssetVocabulary;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class AssetVocabularyCacheModel implements CacheModel<AssetVocabulary>,
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(", vocabularyId=");
043 sb.append(vocabularyId);
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(", name=");
057 sb.append(name);
058 sb.append(", title=");
059 sb.append(title);
060 sb.append(", description=");
061 sb.append(description);
062 sb.append(", settings=");
063 sb.append(settings);
064 sb.append("}");
065
066 return sb.toString();
067 }
068
069 public AssetVocabulary toEntityModel() {
070 AssetVocabularyImpl assetVocabularyImpl = new AssetVocabularyImpl();
071
072 if (uuid == null) {
073 assetVocabularyImpl.setUuid(StringPool.BLANK);
074 }
075 else {
076 assetVocabularyImpl.setUuid(uuid);
077 }
078
079 assetVocabularyImpl.setVocabularyId(vocabularyId);
080 assetVocabularyImpl.setGroupId(groupId);
081 assetVocabularyImpl.setCompanyId(companyId);
082 assetVocabularyImpl.setUserId(userId);
083
084 if (userName == null) {
085 assetVocabularyImpl.setUserName(StringPool.BLANK);
086 }
087 else {
088 assetVocabularyImpl.setUserName(userName);
089 }
090
091 if (createDate == Long.MIN_VALUE) {
092 assetVocabularyImpl.setCreateDate(null);
093 }
094 else {
095 assetVocabularyImpl.setCreateDate(new Date(createDate));
096 }
097
098 if (modifiedDate == Long.MIN_VALUE) {
099 assetVocabularyImpl.setModifiedDate(null);
100 }
101 else {
102 assetVocabularyImpl.setModifiedDate(new Date(modifiedDate));
103 }
104
105 if (name == null) {
106 assetVocabularyImpl.setName(StringPool.BLANK);
107 }
108 else {
109 assetVocabularyImpl.setName(name);
110 }
111
112 if (title == null) {
113 assetVocabularyImpl.setTitle(StringPool.BLANK);
114 }
115 else {
116 assetVocabularyImpl.setTitle(title);
117 }
118
119 if (description == null) {
120 assetVocabularyImpl.setDescription(StringPool.BLANK);
121 }
122 else {
123 assetVocabularyImpl.setDescription(description);
124 }
125
126 if (settings == null) {
127 assetVocabularyImpl.setSettings(StringPool.BLANK);
128 }
129 else {
130 assetVocabularyImpl.setSettings(settings);
131 }
132
133 assetVocabularyImpl.resetOriginalValues();
134
135 return assetVocabularyImpl;
136 }
137
138 public String uuid;
139 public long vocabularyId;
140 public long groupId;
141 public long companyId;
142 public long userId;
143 public String userName;
144 public long createDate;
145 public long modifiedDate;
146 public String name;
147 public String title;
148 public String description;
149 public String settings;
150 }