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