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.DLFileVersion;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing DLFileVersion in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLFileVersion
032     * @generated
033     */
034    public class DLFileVersionCacheModel implements CacheModel<DLFileVersion>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(49);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", fileVersionId=");
043                    sb.append(fileVersionId);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", companyId=");
047                    sb.append(companyId);
048                    sb.append(", userId=");
049                    sb.append(userId);
050                    sb.append(", userName=");
051                    sb.append(userName);
052                    sb.append(", createDate=");
053                    sb.append(createDate);
054                    sb.append(", modifiedDate=");
055                    sb.append(modifiedDate);
056                    sb.append(", repositoryId=");
057                    sb.append(repositoryId);
058                    sb.append(", folderId=");
059                    sb.append(folderId);
060                    sb.append(", fileEntryId=");
061                    sb.append(fileEntryId);
062                    sb.append(", extension=");
063                    sb.append(extension);
064                    sb.append(", mimeType=");
065                    sb.append(mimeType);
066                    sb.append(", title=");
067                    sb.append(title);
068                    sb.append(", description=");
069                    sb.append(description);
070                    sb.append(", changeLog=");
071                    sb.append(changeLog);
072                    sb.append(", extraSettings=");
073                    sb.append(extraSettings);
074                    sb.append(", fileEntryTypeId=");
075                    sb.append(fileEntryTypeId);
076                    sb.append(", version=");
077                    sb.append(version);
078                    sb.append(", size=");
079                    sb.append(size);
080                    sb.append(", status=");
081                    sb.append(status);
082                    sb.append(", statusByUserId=");
083                    sb.append(statusByUserId);
084                    sb.append(", statusByUserName=");
085                    sb.append(statusByUserName);
086                    sb.append(", statusDate=");
087                    sb.append(statusDate);
088                    sb.append("}");
089    
090                    return sb.toString();
091            }
092    
093            public DLFileVersion toEntityModel() {
094                    DLFileVersionImpl dlFileVersionImpl = new DLFileVersionImpl();
095    
096                    if (uuid == null) {
097                            dlFileVersionImpl.setUuid(StringPool.BLANK);
098                    }
099                    else {
100                            dlFileVersionImpl.setUuid(uuid);
101                    }
102    
103                    dlFileVersionImpl.setFileVersionId(fileVersionId);
104                    dlFileVersionImpl.setGroupId(groupId);
105                    dlFileVersionImpl.setCompanyId(companyId);
106                    dlFileVersionImpl.setUserId(userId);
107    
108                    if (userName == null) {
109                            dlFileVersionImpl.setUserName(StringPool.BLANK);
110                    }
111                    else {
112                            dlFileVersionImpl.setUserName(userName);
113                    }
114    
115                    if (createDate == Long.MIN_VALUE) {
116                            dlFileVersionImpl.setCreateDate(null);
117                    }
118                    else {
119                            dlFileVersionImpl.setCreateDate(new Date(createDate));
120                    }
121    
122                    if (modifiedDate == Long.MIN_VALUE) {
123                            dlFileVersionImpl.setModifiedDate(null);
124                    }
125                    else {
126                            dlFileVersionImpl.setModifiedDate(new Date(modifiedDate));
127                    }
128    
129                    dlFileVersionImpl.setRepositoryId(repositoryId);
130                    dlFileVersionImpl.setFolderId(folderId);
131                    dlFileVersionImpl.setFileEntryId(fileEntryId);
132    
133                    if (extension == null) {
134                            dlFileVersionImpl.setExtension(StringPool.BLANK);
135                    }
136                    else {
137                            dlFileVersionImpl.setExtension(extension);
138                    }
139    
140                    if (mimeType == null) {
141                            dlFileVersionImpl.setMimeType(StringPool.BLANK);
142                    }
143                    else {
144                            dlFileVersionImpl.setMimeType(mimeType);
145                    }
146    
147                    if (title == null) {
148                            dlFileVersionImpl.setTitle(StringPool.BLANK);
149                    }
150                    else {
151                            dlFileVersionImpl.setTitle(title);
152                    }
153    
154                    if (description == null) {
155                            dlFileVersionImpl.setDescription(StringPool.BLANK);
156                    }
157                    else {
158                            dlFileVersionImpl.setDescription(description);
159                    }
160    
161                    if (changeLog == null) {
162                            dlFileVersionImpl.setChangeLog(StringPool.BLANK);
163                    }
164                    else {
165                            dlFileVersionImpl.setChangeLog(changeLog);
166                    }
167    
168                    if (extraSettings == null) {
169                            dlFileVersionImpl.setExtraSettings(StringPool.BLANK);
170                    }
171                    else {
172                            dlFileVersionImpl.setExtraSettings(extraSettings);
173                    }
174    
175                    dlFileVersionImpl.setFileEntryTypeId(fileEntryTypeId);
176    
177                    if (version == null) {
178                            dlFileVersionImpl.setVersion(StringPool.BLANK);
179                    }
180                    else {
181                            dlFileVersionImpl.setVersion(version);
182                    }
183    
184                    dlFileVersionImpl.setSize(size);
185                    dlFileVersionImpl.setStatus(status);
186                    dlFileVersionImpl.setStatusByUserId(statusByUserId);
187    
188                    if (statusByUserName == null) {
189                            dlFileVersionImpl.setStatusByUserName(StringPool.BLANK);
190                    }
191                    else {
192                            dlFileVersionImpl.setStatusByUserName(statusByUserName);
193                    }
194    
195                    if (statusDate == Long.MIN_VALUE) {
196                            dlFileVersionImpl.setStatusDate(null);
197                    }
198                    else {
199                            dlFileVersionImpl.setStatusDate(new Date(statusDate));
200                    }
201    
202                    dlFileVersionImpl.resetOriginalValues();
203    
204                    return dlFileVersionImpl;
205            }
206    
207            public String uuid;
208            public long fileVersionId;
209            public long groupId;
210            public long companyId;
211            public long userId;
212            public String userName;
213            public long createDate;
214            public long modifiedDate;
215            public long repositoryId;
216            public long folderId;
217            public long fileEntryId;
218            public String extension;
219            public String mimeType;
220            public String title;
221            public String description;
222            public String changeLog;
223            public String extraSettings;
224            public long fileEntryTypeId;
225            public String version;
226            public long size;
227            public int status;
228            public long statusByUserId;
229            public String statusByUserName;
230            public long statusDate;
231    }