001
014
015 package com.liferay.portlet.ratings.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.model.CacheModel;
019
020 import com.liferay.portlet.ratings.model.RatingsStats;
021
022 import java.io.Serializable;
023
024
031 public class RatingsStatsCacheModel implements CacheModel<RatingsStats>,
032 Serializable {
033 @Override
034 public String toString() {
035 StringBundler sb = new StringBundler(13);
036
037 sb.append("{statsId=");
038 sb.append(statsId);
039 sb.append(", classNameId=");
040 sb.append(classNameId);
041 sb.append(", classPK=");
042 sb.append(classPK);
043 sb.append(", totalEntries=");
044 sb.append(totalEntries);
045 sb.append(", totalScore=");
046 sb.append(totalScore);
047 sb.append(", averageScore=");
048 sb.append(averageScore);
049 sb.append("}");
050
051 return sb.toString();
052 }
053
054 public RatingsStats toEntityModel() {
055 RatingsStatsImpl ratingsStatsImpl = new RatingsStatsImpl();
056
057 ratingsStatsImpl.setStatsId(statsId);
058 ratingsStatsImpl.setClassNameId(classNameId);
059 ratingsStatsImpl.setClassPK(classPK);
060 ratingsStatsImpl.setTotalEntries(totalEntries);
061 ratingsStatsImpl.setTotalScore(totalScore);
062 ratingsStatsImpl.setAverageScore(averageScore);
063
064 ratingsStatsImpl.resetOriginalValues();
065
066 return ratingsStatsImpl;
067 }
068
069 public long statsId;
070 public long classNameId;
071 public long classPK;
072 public int totalEntries;
073 public double totalScore;
074 public double averageScore;
075 }