001    /**
002     * Copyright (c) 2000-2012 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            public SocialRequest toEntityModel() {
073                    SocialRequestImpl socialRequestImpl = new SocialRequestImpl();
074    
075                    if (uuid == null) {
076                            socialRequestImpl.setUuid(StringPool.BLANK);
077                    }
078                    else {
079                            socialRequestImpl.setUuid(uuid);
080                    }
081    
082                    socialRequestImpl.setRequestId(requestId);
083                    socialRequestImpl.setGroupId(groupId);
084                    socialRequestImpl.setCompanyId(companyId);
085                    socialRequestImpl.setUserId(userId);
086                    socialRequestImpl.setCreateDate(createDate);
087                    socialRequestImpl.setModifiedDate(modifiedDate);
088                    socialRequestImpl.setClassNameId(classNameId);
089                    socialRequestImpl.setClassPK(classPK);
090                    socialRequestImpl.setType(type);
091    
092                    if (extraData == null) {
093                            socialRequestImpl.setExtraData(StringPool.BLANK);
094                    }
095                    else {
096                            socialRequestImpl.setExtraData(extraData);
097                    }
098    
099                    socialRequestImpl.setReceiverUserId(receiverUserId);
100                    socialRequestImpl.setStatus(status);
101    
102                    socialRequestImpl.resetOriginalValues();
103    
104                    return socialRequestImpl;
105            }
106    
107            public void readExternal(ObjectInput objectInput) throws IOException {
108                    uuid = objectInput.readUTF();
109                    requestId = objectInput.readLong();
110                    groupId = objectInput.readLong();
111                    companyId = objectInput.readLong();
112                    userId = objectInput.readLong();
113                    createDate = objectInput.readLong();
114                    modifiedDate = objectInput.readLong();
115                    classNameId = objectInput.readLong();
116                    classPK = objectInput.readLong();
117                    type = objectInput.readInt();
118                    extraData = objectInput.readUTF();
119                    receiverUserId = objectInput.readLong();
120                    status = objectInput.readInt();
121            }
122    
123            public void writeExternal(ObjectOutput objectOutput)
124                    throws IOException {
125                    if (uuid == null) {
126                            objectOutput.writeUTF(StringPool.BLANK);
127                    }
128                    else {
129                            objectOutput.writeUTF(uuid);
130                    }
131    
132                    objectOutput.writeLong(requestId);
133                    objectOutput.writeLong(groupId);
134                    objectOutput.writeLong(companyId);
135                    objectOutput.writeLong(userId);
136                    objectOutput.writeLong(createDate);
137                    objectOutput.writeLong(modifiedDate);
138                    objectOutput.writeLong(classNameId);
139                    objectOutput.writeLong(classPK);
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                    objectOutput.writeInt(status);
151            }
152    
153            public String uuid;
154            public long requestId;
155            public long groupId;
156            public long companyId;
157            public long userId;
158            public long createDate;
159            public long modifiedDate;
160            public long classNameId;
161            public long classPK;
162            public int type;
163            public String extraData;
164            public long receiverUserId;
165            public int status;
166    }