001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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(19);
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(", repositoryId=");
050                    sb.append(repositoryId);
051                    sb.append(", parentFolderId=");
052                    sb.append(parentFolderId);
053                    sb.append(", event=");
054                    sb.append(event);
055                    sb.append(", type=");
056                    sb.append(type);
057                    sb.append("}");
058    
059                    return sb.toString();
060            }
061    
062            public DLSync toEntityModel() {
063                    DLSyncImpl dlSyncImpl = new DLSyncImpl();
064    
065                    dlSyncImpl.setSyncId(syncId);
066                    dlSyncImpl.setCompanyId(companyId);
067    
068                    if (createDate == Long.MIN_VALUE) {
069                            dlSyncImpl.setCreateDate(null);
070                    }
071                    else {
072                            dlSyncImpl.setCreateDate(new Date(createDate));
073                    }
074    
075                    if (modifiedDate == Long.MIN_VALUE) {
076                            dlSyncImpl.setModifiedDate(null);
077                    }
078                    else {
079                            dlSyncImpl.setModifiedDate(new Date(modifiedDate));
080                    }
081    
082                    dlSyncImpl.setFileId(fileId);
083                    dlSyncImpl.setRepositoryId(repositoryId);
084                    dlSyncImpl.setParentFolderId(parentFolderId);
085    
086                    if (event == null) {
087                            dlSyncImpl.setEvent(StringPool.BLANK);
088                    }
089                    else {
090                            dlSyncImpl.setEvent(event);
091                    }
092    
093                    if (type == null) {
094                            dlSyncImpl.setType(StringPool.BLANK);
095                    }
096                    else {
097                            dlSyncImpl.setType(type);
098                    }
099    
100                    dlSyncImpl.resetOriginalValues();
101    
102                    return dlSyncImpl;
103            }
104    
105            public long syncId;
106            public long companyId;
107            public long createDate;
108            public long modifiedDate;
109            public long fileId;
110            public long repositoryId;
111            public long parentFolderId;
112            public String event;
113            public String type;
114    }