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.SocialRequest;
022    
023    import java.io.Externalizable;
024    import java.io.IOException;
025    import java.io.ObjectInput;
026    import java.io.ObjectOutput;
027    
028    /**
029     * The cache model class for representing SocialRequest in entity cache.
030     *
031     * @author Brian Wing Shun Chan
032     * @see SocialRequest
033     * @generated
034     */
035    public class SocialRequestCacheModel implements CacheModel<SocialRequest>,
036            Externalizable {
037            @Override
038            public String toString() {
039                    StringBundler sb = new StringBundler(27);
040    
041                    sb.append("{uuid=");
042                    sb.append(uuid);
043                    sb.append(", requestId=");
044                    sb.append(requestId);
045                    sb.append(", groupId=");
046                    sb.append(groupId);
047                    sb.append(", companyId=");
048                    sb.append(companyId);
049                    sb.append(", userId=");
050                    sb.append(userId);
051                    sb.append(", createDate=");
052                    sb.append(createDate);
053                    sb.append(", modifiedDate=");
054                    sb.append(modifiedDate);
055                    sb.append(", classNameId=");
056                    sb.append(classNameId);
057                    sb.append(", classPK=");
058                    sb.append(classPK);
059                    sb.append(", type=");
060                    sb.append(type);
061                    sb.append(", extraData=");
062                    sb.append(extraData);
063                    sb.append(", receiverUserId=");
064                    sb.append(receiverUserId);
065                    sb.append(", status=");
066                    sb.append(status);
067                    sb.append("}");
068    
069                    return sb.toString();
070            }
071    
072            @Override
073            public SocialRequest toEntityModel() {
074                    SocialRequestImpl socialRequestImpl = new SocialRequestImpl();
075    
076                    if (uuid == null) {
077                            socialRequestImpl.setUuid(StringPool.BLANK);
078                    }
079                    else {
080                            socialRequestImpl.setUuid(uuid);
081                    }
082    
083                    socialRequestImpl.setRequestId(requestId);
084                    socialRequestImpl.setGroupId(groupId);
085                    socialRequestImpl.setCompanyId(companyId);
086                    socialRequestImpl.setUserId(userId);
087                    socialRequestImpl.setCreateDate(createDate);
088                    socialRequestImpl.setModifiedDate(modifiedDate);
089                    socialRequestImpl.setClassNameId(classNameId);
090                    socialRequestImpl.setClassPK(classPK);
091                    socialRequestImpl.setType(type);
092    
093                    if (extraData == null) {
094                            socialRequestImpl.setExtraData(StringPool.BLANK);
095                    }
096                    else {
097                            socialRequestImpl.setExtraData(extraData);
098                    }
099    
100                    socialRequestImpl.setReceiverUserId(receiverUserId);
101                    socialRequestImpl.setStatus(status);
102    
103                    socialRequestImpl.resetOriginalValues();
104    
105                    return socialRequestImpl;
106            }
107    
108            @Override
109            public void readExternal(ObjectInput objectInput) throws IOException {
110                    uuid = objectInput.readUTF();
111                    requestId = objectInput.readLong();
112                    groupId = objectInput.readLong();
113                    companyId = objectInput.readLong();
114                    userId = objectInput.readLong();
115                    createDate = objectInput.readLong();
116                    modifiedDate = objectInput.readLong();
117                    classNameId = objectInput.readLong();
118                    classPK = objectInput.readLong();
119                    type = objectInput.readInt();
120                    extraData = objectInput.readUTF();
121                    receiverUserId = objectInput.readLong();
122                    status = objectInput.readInt();
123            }
124    
125            @Override
126            public void writeExternal(ObjectOutput objectOutput)
127                    throws IOException {
128                    if (uuid == null) {
129                            objectOutput.writeUTF(StringPool.BLANK);
130                    }
131                    else {
132                            objectOutput.writeUTF(uuid);
133                    }
134    
135                    objectOutput.writeLong(requestId);
136                    objectOutput.writeLong(groupId);
137                    objectOutput.writeLong(companyId);
138                    objectOutput.writeLong(userId);
139                    objectOutput.writeLong(createDate);
140                    objectOutput.writeLong(modifiedDate);
141                    objectOutput.writeLong(classNameId);
142                    objectOutput.writeLong(classPK);
143                    objectOutput.writeInt(type);
144    
145                    if (extraData == null) {
146                            objectOutput.writeUTF(StringPool.BLANK);
147                    }
148                    else {
149                            objectOutput.writeUTF(extraData);
150                    }
151    
152                    objectOutput.writeLong(receiverUserId);
153                    objectOutput.writeInt(status);
154            }
155    
156            public String uuid;
157            public long requestId;
158            public long groupId;
159            public long companyId;
160            public long userId;
161            public long createDate;
162            public long modifiedDate;
163            public long classNameId;
164            public long classPK;
165            public int type;
166            public String extraData;
167            public long receiverUserId;
168            public int status;
169    }