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.DLFileShortcut;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing DLFileShortcut in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLFileShortcut
032     * @generated
033     */
034    public class DLFileShortcutCacheModel implements CacheModel<DLFileShortcut>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(31);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", fileShortcutId=");
043                    sb.append(fileShortcutId);
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(", toFileEntryId=");
061                    sb.append(toFileEntryId);
062                    sb.append(", status=");
063                    sb.append(status);
064                    sb.append(", statusByUserId=");
065                    sb.append(statusByUserId);
066                    sb.append(", statusByUserName=");
067                    sb.append(statusByUserName);
068                    sb.append(", statusDate=");
069                    sb.append(statusDate);
070                    sb.append("}");
071    
072                    return sb.toString();
073            }
074    
075            public DLFileShortcut toEntityModel() {
076                    DLFileShortcutImpl dlFileShortcutImpl = new DLFileShortcutImpl();
077    
078                    if (uuid == null) {
079                            dlFileShortcutImpl.setUuid(StringPool.BLANK);
080                    }
081                    else {
082                            dlFileShortcutImpl.setUuid(uuid);
083                    }
084    
085                    dlFileShortcutImpl.setFileShortcutId(fileShortcutId);
086                    dlFileShortcutImpl.setGroupId(groupId);
087                    dlFileShortcutImpl.setCompanyId(companyId);
088                    dlFileShortcutImpl.setUserId(userId);
089    
090                    if (userName == null) {
091                            dlFileShortcutImpl.setUserName(StringPool.BLANK);
092                    }
093                    else {
094                            dlFileShortcutImpl.setUserName(userName);
095                    }
096    
097                    if (createDate == Long.MIN_VALUE) {
098                            dlFileShortcutImpl.setCreateDate(null);
099                    }
100                    else {
101                            dlFileShortcutImpl.setCreateDate(new Date(createDate));
102                    }
103    
104                    if (modifiedDate == Long.MIN_VALUE) {
105                            dlFileShortcutImpl.setModifiedDate(null);
106                    }
107                    else {
108                            dlFileShortcutImpl.setModifiedDate(new Date(modifiedDate));
109                    }
110    
111                    dlFileShortcutImpl.setRepositoryId(repositoryId);
112                    dlFileShortcutImpl.setFolderId(folderId);
113                    dlFileShortcutImpl.setToFileEntryId(toFileEntryId);
114                    dlFileShortcutImpl.setStatus(status);
115                    dlFileShortcutImpl.setStatusByUserId(statusByUserId);
116    
117                    if (statusByUserName == null) {
118                            dlFileShortcutImpl.setStatusByUserName(StringPool.BLANK);
119                    }
120                    else {
121                            dlFileShortcutImpl.setStatusByUserName(statusByUserName);
122                    }
123    
124                    if (statusDate == Long.MIN_VALUE) {
125                            dlFileShortcutImpl.setStatusDate(null);
126                    }
127                    else {
128                            dlFileShortcutImpl.setStatusDate(new Date(statusDate));
129                    }
130    
131                    dlFileShortcutImpl.resetOriginalValues();
132    
133                    return dlFileShortcutImpl;
134            }
135    
136            public String uuid;
137            public long fileShortcutId;
138            public long groupId;
139            public long companyId;
140            public long userId;
141            public String userName;
142            public long createDate;
143            public long modifiedDate;
144            public long repositoryId;
145            public long folderId;
146            public long toFileEntryId;
147            public int status;
148            public long statusByUserId;
149            public String statusByUserName;
150            public long statusDate;
151    }