001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
025     * The cache model class for representing RatingsStats in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see RatingsStats
029     * @generated
030     */
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    }