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.SocialActivity;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing SocialActivity in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialActivity
030     * @generated
031     */
032    public class SocialActivityCacheModel implements CacheModel<SocialActivity>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(23);
037    
038                    sb.append("{activityId=");
039                    sb.append(activityId);
040                    sb.append(", groupId=");
041                    sb.append(groupId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", userId=");
045                    sb.append(userId);
046                    sb.append(", createDate=");
047                    sb.append(createDate);
048                    sb.append(", mirrorActivityId=");
049                    sb.append(mirrorActivityId);
050                    sb.append(", classNameId=");
051                    sb.append(classNameId);
052                    sb.append(", classPK=");
053                    sb.append(classPK);
054                    sb.append(", type=");
055                    sb.append(type);
056                    sb.append(", extraData=");
057                    sb.append(extraData);
058                    sb.append(", receiverUserId=");
059                    sb.append(receiverUserId);
060                    sb.append("}");
061    
062                    return sb.toString();
063            }
064    
065            public SocialActivity toEntityModel() {
066                    SocialActivityImpl socialActivityImpl = new SocialActivityImpl();
067    
068                    socialActivityImpl.setActivityId(activityId);
069                    socialActivityImpl.setGroupId(groupId);
070                    socialActivityImpl.setCompanyId(companyId);
071                    socialActivityImpl.setUserId(userId);
072                    socialActivityImpl.setCreateDate(createDate);
073                    socialActivityImpl.setMirrorActivityId(mirrorActivityId);
074                    socialActivityImpl.setClassNameId(classNameId);
075                    socialActivityImpl.setClassPK(classPK);
076                    socialActivityImpl.setType(type);
077    
078                    if (extraData == null) {
079                            socialActivityImpl.setExtraData(StringPool.BLANK);
080                    }
081                    else {
082                            socialActivityImpl.setExtraData(extraData);
083                    }
084    
085                    socialActivityImpl.setReceiverUserId(receiverUserId);
086    
087                    socialActivityImpl.resetOriginalValues();
088    
089                    return socialActivityImpl;
090            }
091    
092            public long activityId;
093            public long groupId;
094            public long companyId;
095            public long userId;
096            public long createDate;
097            public long mirrorActivityId;
098            public long classNameId;
099            public long classPK;
100            public int type;
101            public String extraData;
102            public long receiverUserId;
103    }