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.AssetCategoryProperty;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class AssetCategoryPropertyCacheModel implements CacheModel<AssetCategoryProperty>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(19);
039
040 sb.append("{categoryPropertyId=");
041 sb.append(categoryPropertyId);
042 sb.append(", companyId=");
043 sb.append(companyId);
044 sb.append(", userId=");
045 sb.append(userId);
046 sb.append(", userName=");
047 sb.append(userName);
048 sb.append(", createDate=");
049 sb.append(createDate);
050 sb.append(", modifiedDate=");
051 sb.append(modifiedDate);
052 sb.append(", categoryId=");
053 sb.append(categoryId);
054 sb.append(", key=");
055 sb.append(key);
056 sb.append(", value=");
057 sb.append(value);
058 sb.append("}");
059
060 return sb.toString();
061 }
062
063 public AssetCategoryProperty toEntityModel() {
064 AssetCategoryPropertyImpl assetCategoryPropertyImpl = new AssetCategoryPropertyImpl();
065
066 assetCategoryPropertyImpl.setCategoryPropertyId(categoryPropertyId);
067 assetCategoryPropertyImpl.setCompanyId(companyId);
068 assetCategoryPropertyImpl.setUserId(userId);
069
070 if (userName == null) {
071 assetCategoryPropertyImpl.setUserName(StringPool.BLANK);
072 }
073 else {
074 assetCategoryPropertyImpl.setUserName(userName);
075 }
076
077 if (createDate == Long.MIN_VALUE) {
078 assetCategoryPropertyImpl.setCreateDate(null);
079 }
080 else {
081 assetCategoryPropertyImpl.setCreateDate(new Date(createDate));
082 }
083
084 if (modifiedDate == Long.MIN_VALUE) {
085 assetCategoryPropertyImpl.setModifiedDate(null);
086 }
087 else {
088 assetCategoryPropertyImpl.setModifiedDate(new Date(modifiedDate));
089 }
090
091 assetCategoryPropertyImpl.setCategoryId(categoryId);
092
093 if (key == null) {
094 assetCategoryPropertyImpl.setKey(StringPool.BLANK);
095 }
096 else {
097 assetCategoryPropertyImpl.setKey(key);
098 }
099
100 if (value == null) {
101 assetCategoryPropertyImpl.setValue(StringPool.BLANK);
102 }
103 else {
104 assetCategoryPropertyImpl.setValue(value);
105 }
106
107 assetCategoryPropertyImpl.resetOriginalValues();
108
109 return assetCategoryPropertyImpl;
110 }
111
112 public long categoryPropertyId;
113 public long companyId;
114 public long userId;
115 public String userName;
116 public long createDate;
117 public long modifiedDate;
118 public long categoryId;
119 public String key;
120 public String value;
121 }