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.SocialActivity;
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 SocialActivity in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see SocialActivity
035     * @generated
036     */
037    @ProviderType
038    public class SocialActivityCacheModel implements CacheModel<SocialActivity>,
039            Externalizable {
040            @Override
041            public String toString() {
042                    StringBundler sb = new StringBundler(29);
043    
044                    sb.append("{activityId=");
045                    sb.append(activityId);
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(", activitySetId=");
055                    sb.append(activitySetId);
056                    sb.append(", mirrorActivityId=");
057                    sb.append(mirrorActivityId);
058                    sb.append(", classNameId=");
059                    sb.append(classNameId);
060                    sb.append(", classPK=");
061                    sb.append(classPK);
062                    sb.append(", parentClassNameId=");
063                    sb.append(parentClassNameId);
064                    sb.append(", parentClassPK=");
065                    sb.append(parentClassPK);
066                    sb.append(", type=");
067                    sb.append(type);
068                    sb.append(", extraData=");
069                    sb.append(extraData);
070                    sb.append(", receiverUserId=");
071                    sb.append(receiverUserId);
072                    sb.append("}");
073    
074                    return sb.toString();
075            }
076    
077            @Override
078            public SocialActivity toEntityModel() {
079                    SocialActivityImpl socialActivityImpl = new SocialActivityImpl();
080    
081                    socialActivityImpl.setActivityId(activityId);
082                    socialActivityImpl.setGroupId(groupId);
083                    socialActivityImpl.setCompanyId(companyId);
084                    socialActivityImpl.setUserId(userId);
085                    socialActivityImpl.setCreateDate(createDate);
086                    socialActivityImpl.setActivitySetId(activitySetId);
087                    socialActivityImpl.setMirrorActivityId(mirrorActivityId);
088                    socialActivityImpl.setClassNameId(classNameId);
089                    socialActivityImpl.setClassPK(classPK);
090                    socialActivityImpl.setParentClassNameId(parentClassNameId);
091                    socialActivityImpl.setParentClassPK(parentClassPK);
092                    socialActivityImpl.setType(type);
093    
094                    if (extraData == null) {
095                            socialActivityImpl.setExtraData(StringPool.BLANK);
096                    }
097                    else {
098                            socialActivityImpl.setExtraData(extraData);
099                    }
100    
101                    socialActivityImpl.setReceiverUserId(receiverUserId);
102    
103                    socialActivityImpl.resetOriginalValues();
104    
105                    return socialActivityImpl;
106            }
107    
108            @Override
109            public void readExternal(ObjectInput objectInput) throws IOException {
110                    activityId = objectInput.readLong();
111                    groupId = objectInput.readLong();
112                    companyId = objectInput.readLong();
113                    userId = objectInput.readLong();
114                    createDate = objectInput.readLong();
115                    activitySetId = objectInput.readLong();
116                    mirrorActivityId = objectInput.readLong();
117                    classNameId = objectInput.readLong();
118                    classPK = objectInput.readLong();
119                    parentClassNameId = objectInput.readLong();
120                    parentClassPK = objectInput.readLong();
121                    type = objectInput.readInt();
122                    extraData = objectInput.readUTF();
123                    receiverUserId = objectInput.readLong();
124            }
125    
126            @Override
127            public void writeExternal(ObjectOutput objectOutput)
128                    throws IOException {
129                    objectOutput.writeLong(activityId);
130                    objectOutput.writeLong(groupId);
131                    objectOutput.writeLong(companyId);
132                    objectOutput.writeLong(userId);
133                    objectOutput.writeLong(createDate);
134                    objectOutput.writeLong(activitySetId);
135                    objectOutput.writeLong(mirrorActivityId);
136                    objectOutput.writeLong(classNameId);
137                    objectOutput.writeLong(classPK);
138                    objectOutput.writeLong(parentClassNameId);
139                    objectOutput.writeLong(parentClassPK);
140                    objectOutput.writeInt(type);
141    
142                    if (extraData == null) {
143                            objectOutput.writeUTF(StringPool.BLANK);
144                    }
145                    else {
146                            objectOutput.writeUTF(extraData);
147                    }
148    
149                    objectOutput.writeLong(receiverUserId);
150            }
151    
152            public long activityId;
153            public long groupId;
154            public long companyId;
155            public long userId;
156            public long createDate;
157            public long activitySetId;
158            public long mirrorActivityId;
159            public long classNameId;
160            public long classPK;
161            public long parentClassNameId;
162            public long parentClassPK;
163            public int type;
164            public String extraData;
165            public long receiverUserId;
166    }