001    /**
002     * Copyright (c) 2000-2012 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.model.CacheModel;
019    
020    import com.liferay.portlet.social.model.SocialActivitySet;
021    
022    import java.io.Externalizable;
023    import java.io.IOException;
024    import java.io.ObjectInput;
025    import java.io.ObjectOutput;
026    
027    /**
028     * The cache model class for representing SocialActivitySet in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see SocialActivitySet
032     * @generated
033     */
034    public class SocialActivitySetCacheModel implements CacheModel<SocialActivitySet>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(21);
039    
040                    sb.append("{activitySetId=");
041                    sb.append(activitySetId);
042                    sb.append(", groupId=");
043                    sb.append(groupId);
044                    sb.append(", companyId=");
045                    sb.append(companyId);
046                    sb.append(", userId=");
047                    sb.append(userId);
048                    sb.append(", createDate=");
049                    sb.append(createDate);
050                    sb.append(", modifiedDate=");
051                    sb.append(modifiedDate);
052                    sb.append(", classNameId=");
053                    sb.append(classNameId);
054                    sb.append(", classPK=");
055                    sb.append(classPK);
056                    sb.append(", type=");
057                    sb.append(type);
058                    sb.append(", activityCount=");
059                    sb.append(activityCount);
060                    sb.append("}");
061    
062                    return sb.toString();
063            }
064    
065            public SocialActivitySet toEntityModel() {
066                    SocialActivitySetImpl socialActivitySetImpl = new SocialActivitySetImpl();
067    
068                    socialActivitySetImpl.setActivitySetId(activitySetId);
069                    socialActivitySetImpl.setGroupId(groupId);
070                    socialActivitySetImpl.setCompanyId(companyId);
071                    socialActivitySetImpl.setUserId(userId);
072                    socialActivitySetImpl.setCreateDate(createDate);
073                    socialActivitySetImpl.setModifiedDate(modifiedDate);
074                    socialActivitySetImpl.setClassNameId(classNameId);
075                    socialActivitySetImpl.setClassPK(classPK);
076                    socialActivitySetImpl.setType(type);
077                    socialActivitySetImpl.setActivityCount(activityCount);
078    
079                    socialActivitySetImpl.resetOriginalValues();
080    
081                    return socialActivitySetImpl;
082            }
083    
084            public void readExternal(ObjectInput objectInput) throws IOException {
085                    activitySetId = objectInput.readLong();
086                    groupId = objectInput.readLong();
087                    companyId = objectInput.readLong();
088                    userId = objectInput.readLong();
089                    createDate = objectInput.readLong();
090                    modifiedDate = objectInput.readLong();
091                    classNameId = objectInput.readLong();
092                    classPK = objectInput.readLong();
093                    type = objectInput.readInt();
094                    activityCount = objectInput.readInt();
095            }
096    
097            public void writeExternal(ObjectOutput objectOutput)
098                    throws IOException {
099                    objectOutput.writeLong(activitySetId);
100                    objectOutput.writeLong(groupId);
101                    objectOutput.writeLong(companyId);
102                    objectOutput.writeLong(userId);
103                    objectOutput.writeLong(createDate);
104                    objectOutput.writeLong(modifiedDate);
105                    objectOutput.writeLong(classNameId);
106                    objectOutput.writeLong(classPK);
107                    objectOutput.writeInt(type);
108                    objectOutput.writeInt(activityCount);
109            }
110    
111            public long activitySetId;
112            public long groupId;
113            public long companyId;
114            public long userId;
115            public long createDate;
116            public long modifiedDate;
117            public long classNameId;
118            public long classPK;
119            public int type;
120            public int activityCount;
121    }