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