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.SocialActivityAchievement;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing SocialActivityAchievement in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialActivityAchievement
030     * @generated
031     */
032    public class SocialActivityAchievementCacheModel implements CacheModel<SocialActivityAchievement>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(15);
037    
038                    sb.append("{activityAchievementId=");
039                    sb.append(activityAchievementId);
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(", name=");
049                    sb.append(name);
050                    sb.append(", firstInGroup=");
051                    sb.append(firstInGroup);
052                    sb.append("}");
053    
054                    return sb.toString();
055            }
056    
057            public SocialActivityAchievement toEntityModel() {
058                    SocialActivityAchievementImpl socialActivityAchievementImpl = new SocialActivityAchievementImpl();
059    
060                    socialActivityAchievementImpl.setActivityAchievementId(activityAchievementId);
061                    socialActivityAchievementImpl.setGroupId(groupId);
062                    socialActivityAchievementImpl.setCompanyId(companyId);
063                    socialActivityAchievementImpl.setUserId(userId);
064                    socialActivityAchievementImpl.setCreateDate(createDate);
065    
066                    if (name == null) {
067                            socialActivityAchievementImpl.setName(StringPool.BLANK);
068                    }
069                    else {
070                            socialActivityAchievementImpl.setName(name);
071                    }
072    
073                    socialActivityAchievementImpl.setFirstInGroup(firstInGroup);
074    
075                    socialActivityAchievementImpl.resetOriginalValues();
076    
077                    return socialActivityAchievementImpl;
078            }
079    
080            public long activityAchievementId;
081            public long groupId;
082            public long companyId;
083            public long userId;
084            public long createDate;
085            public String name;
086            public boolean firstInGroup;
087    }