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.documentlibrary.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.documentlibrary.model.DLSync;
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 DLSync in entity cache.
030     *
031     * @author Brian Wing Shun Chan
032     * @see DLSync
033     * @generated
034     */
035    public class DLSyncCacheModel implements CacheModel<DLSync>, Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(27);
039    
040                    sb.append("{syncId=");
041                    sb.append(syncId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", createDate=");
045                    sb.append(createDate);
046                    sb.append(", modifiedDate=");
047                    sb.append(modifiedDate);
048                    sb.append(", fileId=");
049                    sb.append(fileId);
050                    sb.append(", fileUuid=");
051                    sb.append(fileUuid);
052                    sb.append(", repositoryId=");
053                    sb.append(repositoryId);
054                    sb.append(", parentFolderId=");
055                    sb.append(parentFolderId);
056                    sb.append(", name=");
057                    sb.append(name);
058                    sb.append(", description=");
059                    sb.append(description);
060                    sb.append(", event=");
061                    sb.append(event);
062                    sb.append(", type=");
063                    sb.append(type);
064                    sb.append(", version=");
065                    sb.append(version);
066                    sb.append("}");
067    
068                    return sb.toString();
069            }
070    
071            public DLSync toEntityModel() {
072                    DLSyncImpl dlSyncImpl = new DLSyncImpl();
073    
074                    dlSyncImpl.setSyncId(syncId);
075                    dlSyncImpl.setCompanyId(companyId);
076                    dlSyncImpl.setCreateDate(createDate);
077                    dlSyncImpl.setModifiedDate(modifiedDate);
078                    dlSyncImpl.setFileId(fileId);
079    
080                    if (fileUuid == null) {
081                            dlSyncImpl.setFileUuid(StringPool.BLANK);
082                    }
083                    else {
084                            dlSyncImpl.setFileUuid(fileUuid);
085                    }
086    
087                    dlSyncImpl.setRepositoryId(repositoryId);
088                    dlSyncImpl.setParentFolderId(parentFolderId);
089    
090                    if (name == null) {
091                            dlSyncImpl.setName(StringPool.BLANK);
092                    }
093                    else {
094                            dlSyncImpl.setName(name);
095                    }
096    
097                    if (description == null) {
098                            dlSyncImpl.setDescription(StringPool.BLANK);
099                    }
100                    else {
101                            dlSyncImpl.setDescription(description);
102                    }
103    
104                    if (event == null) {
105                            dlSyncImpl.setEvent(StringPool.BLANK);
106                    }
107                    else {
108                            dlSyncImpl.setEvent(event);
109                    }
110    
111                    if (type == null) {
112                            dlSyncImpl.setType(StringPool.BLANK);
113                    }
114                    else {
115                            dlSyncImpl.setType(type);
116                    }
117    
118                    if (version == null) {
119                            dlSyncImpl.setVersion(StringPool.BLANK);
120                    }
121                    else {
122                            dlSyncImpl.setVersion(version);
123                    }
124    
125                    dlSyncImpl.resetOriginalValues();
126    
127                    return dlSyncImpl;
128            }
129    
130            public void readExternal(ObjectInput objectInput) throws IOException {
131                    syncId = objectInput.readLong();
132                    companyId = objectInput.readLong();
133                    createDate = objectInput.readLong();
134                    modifiedDate = objectInput.readLong();
135                    fileId = objectInput.readLong();
136                    fileUuid = objectInput.readUTF();
137                    repositoryId = objectInput.readLong();
138                    parentFolderId = objectInput.readLong();
139                    name = objectInput.readUTF();
140                    description = objectInput.readUTF();
141                    event = objectInput.readUTF();
142                    type = objectInput.readUTF();
143                    version = objectInput.readUTF();
144            }
145    
146            public void writeExternal(ObjectOutput objectOutput)
147                    throws IOException {
148                    objectOutput.writeLong(syncId);
149                    objectOutput.writeLong(companyId);
150                    objectOutput.writeLong(createDate);
151                    objectOutput.writeLong(modifiedDate);
152                    objectOutput.writeLong(fileId);
153    
154                    if (fileUuid == null) {
155                            objectOutput.writeUTF(StringPool.BLANK);
156                    }
157                    else {
158                            objectOutput.writeUTF(fileUuid);
159                    }
160    
161                    objectOutput.writeLong(repositoryId);
162                    objectOutput.writeLong(parentFolderId);
163    
164                    if (name == null) {
165                            objectOutput.writeUTF(StringPool.BLANK);
166                    }
167                    else {
168                            objectOutput.writeUTF(name);
169                    }
170    
171                    if (description == null) {
172                            objectOutput.writeUTF(StringPool.BLANK);
173                    }
174                    else {
175                            objectOutput.writeUTF(description);
176                    }
177    
178                    if (event == null) {
179                            objectOutput.writeUTF(StringPool.BLANK);
180                    }
181                    else {
182                            objectOutput.writeUTF(event);
183                    }
184    
185                    if (type == null) {
186                            objectOutput.writeUTF(StringPool.BLANK);
187                    }
188                    else {
189                            objectOutput.writeUTF(type);
190                    }
191    
192                    if (version == null) {
193                            objectOutput.writeUTF(StringPool.BLANK);
194                    }
195                    else {
196                            objectOutput.writeUTF(version);
197                    }
198            }
199    
200            public long syncId;
201            public long companyId;
202            public long createDate;
203            public long modifiedDate;
204            public long fileId;
205            public String fileUuid;
206            public long repositoryId;
207            public long parentFolderId;
208            public String name;
209            public String description;
210            public String event;
211            public String type;
212            public String version;
213    }