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.MDRRuleGroupInstance;
022
023 import java.io.Serializable;
024
025 import java.util.Date;
026
027
034 public class MDRRuleGroupInstanceCacheModel implements CacheModel<MDRRuleGroupInstance>,
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(", ruleGroupInstanceId=");
043 sb.append(ruleGroupInstanceId);
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(", classNameId=");
057 sb.append(classNameId);
058 sb.append(", classPK=");
059 sb.append(classPK);
060 sb.append(", ruleGroupId=");
061 sb.append(ruleGroupId);
062 sb.append(", priority=");
063 sb.append(priority);
064 sb.append("}");
065
066 return sb.toString();
067 }
068
069 public MDRRuleGroupInstance toEntityModel() {
070 MDRRuleGroupInstanceImpl mdrRuleGroupInstanceImpl = new MDRRuleGroupInstanceImpl();
071
072 if (uuid == null) {
073 mdrRuleGroupInstanceImpl.setUuid(StringPool.BLANK);
074 }
075 else {
076 mdrRuleGroupInstanceImpl.setUuid(uuid);
077 }
078
079 mdrRuleGroupInstanceImpl.setRuleGroupInstanceId(ruleGroupInstanceId);
080 mdrRuleGroupInstanceImpl.setGroupId(groupId);
081 mdrRuleGroupInstanceImpl.setCompanyId(companyId);
082 mdrRuleGroupInstanceImpl.setUserId(userId);
083
084 if (userName == null) {
085 mdrRuleGroupInstanceImpl.setUserName(StringPool.BLANK);
086 }
087 else {
088 mdrRuleGroupInstanceImpl.setUserName(userName);
089 }
090
091 if (createDate == Long.MIN_VALUE) {
092 mdrRuleGroupInstanceImpl.setCreateDate(null);
093 }
094 else {
095 mdrRuleGroupInstanceImpl.setCreateDate(new Date(createDate));
096 }
097
098 if (modifiedDate == Long.MIN_VALUE) {
099 mdrRuleGroupInstanceImpl.setModifiedDate(null);
100 }
101 else {
102 mdrRuleGroupInstanceImpl.setModifiedDate(new Date(modifiedDate));
103 }
104
105 mdrRuleGroupInstanceImpl.setClassNameId(classNameId);
106 mdrRuleGroupInstanceImpl.setClassPK(classPK);
107 mdrRuleGroupInstanceImpl.setRuleGroupId(ruleGroupId);
108 mdrRuleGroupInstanceImpl.setPriority(priority);
109
110 mdrRuleGroupInstanceImpl.resetOriginalValues();
111
112 return mdrRuleGroupInstanceImpl;
113 }
114
115 public String uuid;
116 public long ruleGroupInstanceId;
117 public long groupId;
118 public long companyId;
119 public long userId;
120 public String userName;
121 public long createDate;
122 public long modifiedDate;
123 public long classNameId;
124 public long classPK;
125 public long ruleGroupId;
126 public int priority;
127 }