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