001
014
015 package com.liferay.portlet.mobiledevicerules.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.mobiledevicerules.model.MDRRuleGroup;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class MDRRuleGroupCacheModel implements CacheModel<MDRRuleGroup>,
035 Serializable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(21);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", ruleGroupId=");
043 sb.append(ruleGroupId);
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(", description=");
059 sb.append(description);
060 sb.append("}");
061
062 return sb.toString();
063 }
064
065 public MDRRuleGroup toEntityModel() {
066 MDRRuleGroupImpl mdrRuleGroupImpl = new MDRRuleGroupImpl();
067
068 if (uuid == null) {
069 mdrRuleGroupImpl.setUuid(StringPool.BLANK);
070 }
071 else {
072 mdrRuleGroupImpl.setUuid(uuid);
073 }
074
075 mdrRuleGroupImpl.setRuleGroupId(ruleGroupId);
076 mdrRuleGroupImpl.setGroupId(groupId);
077 mdrRuleGroupImpl.setCompanyId(companyId);
078 mdrRuleGroupImpl.setUserId(userId);
079
080 if (userName == null) {
081 mdrRuleGroupImpl.setUserName(StringPool.BLANK);
082 }
083 else {
084 mdrRuleGroupImpl.setUserName(userName);
085 }
086
087 if (createDate == Long.MIN_VALUE) {
088 mdrRuleGroupImpl.setCreateDate(null);
089 }
090 else {
091 mdrRuleGroupImpl.setCreateDate(new Date(createDate));
092 }
093
094 if (modifiedDate == Long.MIN_VALUE) {
095 mdrRuleGroupImpl.setModifiedDate(null);
096 }
097 else {
098 mdrRuleGroupImpl.setModifiedDate(new Date(modifiedDate));
099 }
100
101 if (name == null) {
102 mdrRuleGroupImpl.setName(StringPool.BLANK);
103 }
104 else {
105 mdrRuleGroupImpl.setName(name);
106 }
107
108 if (description == null) {
109 mdrRuleGroupImpl.setDescription(StringPool.BLANK);
110 }
111 else {
112 mdrRuleGroupImpl.setDescription(description);
113 }
114
115 mdrRuleGroupImpl.resetOriginalValues();
116
117 return mdrRuleGroupImpl;
118 }
119
120 public String uuid;
121 public long ruleGroupId;
122 public long groupId;
123 public long companyId;
124 public long userId;
125 public String userName;
126 public long createDate;
127 public long modifiedDate;
128 public String name;
129 public String description;
130 }