001
014
015 package com.liferay.portlet.social.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.social.model.SocialActivityCounter;
022
023 import java.io.Serializable;
024
025
032 public class SocialActivityCounterCacheModel implements CacheModel<SocialActivityCounter>,
033 Serializable {
034 @Override
035 public String toString() {
036 StringBundler sb = new StringBundler(25);
037
038 sb.append("{activityCounterId=");
039 sb.append(activityCounterId);
040 sb.append(", groupId=");
041 sb.append(groupId);
042 sb.append(", companyId=");
043 sb.append(companyId);
044 sb.append(", classNameId=");
045 sb.append(classNameId);
046 sb.append(", classPK=");
047 sb.append(classPK);
048 sb.append(", name=");
049 sb.append(name);
050 sb.append(", ownerType=");
051 sb.append(ownerType);
052 sb.append(", currentValue=");
053 sb.append(currentValue);
054 sb.append(", totalValue=");
055 sb.append(totalValue);
056 sb.append(", graceValue=");
057 sb.append(graceValue);
058 sb.append(", startPeriod=");
059 sb.append(startPeriod);
060 sb.append(", endPeriod=");
061 sb.append(endPeriod);
062 sb.append("}");
063
064 return sb.toString();
065 }
066
067 public SocialActivityCounter toEntityModel() {
068 SocialActivityCounterImpl socialActivityCounterImpl = new SocialActivityCounterImpl();
069
070 socialActivityCounterImpl.setActivityCounterId(activityCounterId);
071 socialActivityCounterImpl.setGroupId(groupId);
072 socialActivityCounterImpl.setCompanyId(companyId);
073 socialActivityCounterImpl.setClassNameId(classNameId);
074 socialActivityCounterImpl.setClassPK(classPK);
075
076 if (name == null) {
077 socialActivityCounterImpl.setName(StringPool.BLANK);
078 }
079 else {
080 socialActivityCounterImpl.setName(name);
081 }
082
083 socialActivityCounterImpl.setOwnerType(ownerType);
084 socialActivityCounterImpl.setCurrentValue(currentValue);
085 socialActivityCounterImpl.setTotalValue(totalValue);
086 socialActivityCounterImpl.setGraceValue(graceValue);
087 socialActivityCounterImpl.setStartPeriod(startPeriod);
088 socialActivityCounterImpl.setEndPeriod(endPeriod);
089
090 socialActivityCounterImpl.resetOriginalValues();
091
092 return socialActivityCounterImpl;
093 }
094
095 public long activityCounterId;
096 public long groupId;
097 public long companyId;
098 public long classNameId;
099 public long classPK;
100 public String name;
101 public int ownerType;
102 public int currentValue;
103 public int totalValue;
104 public int graceValue;
105 public int startPeriod;
106 public int endPeriod;
107 }