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