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.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    /**
026     * The cache model class for representing SocialActivityCounter in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialActivityCounter
030     * @generated
031     */
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    }