001    /**
002     * Copyright (c) 2000-2011 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.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing DLSync in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLSync
032     * @generated
033     */
034    public class DLSyncCacheModel implements CacheModel<DLSync>, Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(25);
038    
039                    sb.append("{syncId=");
040                    sb.append(syncId);
041                    sb.append(", companyId=");
042                    sb.append(companyId);
043                    sb.append(", createDate=");
044                    sb.append(createDate);
045                    sb.append(", modifiedDate=");
046                    sb.append(modifiedDate);
047                    sb.append(", fileId=");
048                    sb.append(fileId);
049                    sb.append(", fileUuid=");
050                    sb.append(fileUuid);
051                    sb.append(", repositoryId=");
052                    sb.append(repositoryId);
053                    sb.append(", parentFolderId=");
054                    sb.append(parentFolderId);
055                    sb.append(", name=");
056                    sb.append(name);
057                    sb.append(", event=");
058                    sb.append(event);
059                    sb.append(", type=");
060                    sb.append(type);
061                    sb.append(", version=");
062                    sb.append(version);
063                    sb.append("}");
064    
065                    return sb.toString();
066            }
067    
068            public DLSync toEntityModel() {
069                    DLSyncImpl dlSyncImpl = new DLSyncImpl();
070    
071                    dlSyncImpl.setSyncId(syncId);
072                    dlSyncImpl.setCompanyId(companyId);
073    
074                    if (createDate == Long.MIN_VALUE) {
075                            dlSyncImpl.setCreateDate(null);
076                    }
077                    else {
078                            dlSyncImpl.setCreateDate(new Date(createDate));
079                    }
080    
081                    if (modifiedDate == Long.MIN_VALUE) {
082                            dlSyncImpl.setModifiedDate(null);
083                    }
084                    else {
085                            dlSyncImpl.setModifiedDate(new Date(modifiedDate));
086                    }
087    
088                    dlSyncImpl.setFileId(fileId);
089    
090                    if (fileUuid == null) {
091                            dlSyncImpl.setFileUuid(StringPool.BLANK);
092                    }
093                    else {
094                            dlSyncImpl.setFileUuid(fileUuid);
095                    }
096    
097                    dlSyncImpl.setRepositoryId(repositoryId);
098                    dlSyncImpl.setParentFolderId(parentFolderId);
099    
100                    if (name == null) {
101                            dlSyncImpl.setName(StringPool.BLANK);
102                    }
103                    else {
104                            dlSyncImpl.setName(name);
105                    }
106    
107                    if (event == null) {
108                            dlSyncImpl.setEvent(StringPool.BLANK);
109                    }
110                    else {
111                            dlSyncImpl.setEvent(event);
112                    }
113    
114                    if (type == null) {
115                            dlSyncImpl.setType(StringPool.BLANK);
116                    }
117                    else {
118                            dlSyncImpl.setType(type);
119                    }
120    
121                    if (version == null) {
122                            dlSyncImpl.setVersion(StringPool.BLANK);
123                    }
124                    else {
125                            dlSyncImpl.setVersion(version);
126                    }
127    
128                    dlSyncImpl.resetOriginalValues();
129    
130                    return dlSyncImpl;
131            }
132    
133            public long syncId;
134            public long companyId;
135            public long createDate;
136            public long modifiedDate;
137            public long fileId;
138            public String fileUuid;
139            public long repositoryId;
140            public long parentFolderId;
141            public String name;
142            public String event;
143            public String type;
144            public String version;
145    }