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.model.CacheModel;
019    
020    import com.liferay.portlet.documentlibrary.model.DLFileRank;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing DLFileRank in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see DLFileRank
031     * @generated
032     */
033    public class DLFileRankCacheModel implements CacheModel<DLFileRank>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(13);
038    
039                    sb.append("{fileRankId=");
040                    sb.append(fileRankId);
041                    sb.append(", groupId=");
042                    sb.append(groupId);
043                    sb.append(", companyId=");
044                    sb.append(companyId);
045                    sb.append(", userId=");
046                    sb.append(userId);
047                    sb.append(", createDate=");
048                    sb.append(createDate);
049                    sb.append(", fileEntryId=");
050                    sb.append(fileEntryId);
051                    sb.append("}");
052    
053                    return sb.toString();
054            }
055    
056            public DLFileRank toEntityModel() {
057                    DLFileRankImpl dlFileRankImpl = new DLFileRankImpl();
058    
059                    dlFileRankImpl.setFileRankId(fileRankId);
060                    dlFileRankImpl.setGroupId(groupId);
061                    dlFileRankImpl.setCompanyId(companyId);
062                    dlFileRankImpl.setUserId(userId);
063    
064                    if (createDate == Long.MIN_VALUE) {
065                            dlFileRankImpl.setCreateDate(null);
066                    }
067                    else {
068                            dlFileRankImpl.setCreateDate(new Date(createDate));
069                    }
070    
071                    dlFileRankImpl.setFileEntryId(fileEntryId);
072    
073                    dlFileRankImpl.resetOriginalValues();
074    
075                    return dlFileRankImpl;
076            }
077    
078            public long fileRankId;
079            public long groupId;
080            public long companyId;
081            public long userId;
082            public long createDate;
083            public long fileEntryId;
084    }