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.SocialRelation;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing SocialRelation in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialRelation
030     * @generated
031     */
032    public class SocialRelationCacheModel implements CacheModel<SocialRelation>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(15);
037    
038                    sb.append("{uuid=");
039                    sb.append(uuid);
040                    sb.append(", relationId=");
041                    sb.append(relationId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", createDate=");
045                    sb.append(createDate);
046                    sb.append(", userId1=");
047                    sb.append(userId1);
048                    sb.append(", userId2=");
049                    sb.append(userId2);
050                    sb.append(", type=");
051                    sb.append(type);
052                    sb.append("}");
053    
054                    return sb.toString();
055            }
056    
057            public SocialRelation toEntityModel() {
058                    SocialRelationImpl socialRelationImpl = new SocialRelationImpl();
059    
060                    if (uuid == null) {
061                            socialRelationImpl.setUuid(StringPool.BLANK);
062                    }
063                    else {
064                            socialRelationImpl.setUuid(uuid);
065                    }
066    
067                    socialRelationImpl.setRelationId(relationId);
068                    socialRelationImpl.setCompanyId(companyId);
069                    socialRelationImpl.setCreateDate(createDate);
070                    socialRelationImpl.setUserId1(userId1);
071                    socialRelationImpl.setUserId2(userId2);
072                    socialRelationImpl.setType(type);
073    
074                    socialRelationImpl.resetOriginalValues();
075    
076                    return socialRelationImpl;
077            }
078    
079            public String uuid;
080            public long relationId;
081            public long companyId;
082            public long createDate;
083            public long userId1;
084            public long userId2;
085            public int type;
086    }