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.DLContent;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing DLContent in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see DLContent
030     * @generated
031     */
032    public class DLContentCacheModel implements CacheModel<DLContent>, Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(15);
036    
037                    sb.append("{contentId=");
038                    sb.append(contentId);
039                    sb.append(", groupId=");
040                    sb.append(groupId);
041                    sb.append(", companyId=");
042                    sb.append(companyId);
043                    sb.append(", repositoryId=");
044                    sb.append(repositoryId);
045                    sb.append(", path=");
046                    sb.append(path);
047                    sb.append(", version=");
048                    sb.append(version);
049                    sb.append(", size=");
050                    sb.append(size);
051                    sb.append("}");
052    
053                    return sb.toString();
054            }
055    
056            public DLContent toEntityModel() {
057                    DLContentImpl dlContentImpl = new DLContentImpl();
058    
059                    dlContentImpl.setContentId(contentId);
060                    dlContentImpl.setGroupId(groupId);
061                    dlContentImpl.setCompanyId(companyId);
062                    dlContentImpl.setRepositoryId(repositoryId);
063    
064                    if (path == null) {
065                            dlContentImpl.setPath(StringPool.BLANK);
066                    }
067                    else {
068                            dlContentImpl.setPath(path);
069                    }
070    
071                    if (version == null) {
072                            dlContentImpl.setVersion(StringPool.BLANK);
073                    }
074                    else {
075                            dlContentImpl.setVersion(version);
076                    }
077    
078                    dlContentImpl.setSize(size);
079    
080                    dlContentImpl.resetOriginalValues();
081    
082                    return dlContentImpl;
083            }
084    
085            public long contentId;
086            public long groupId;
087            public long companyId;
088            public long repositoryId;
089            public String path;
090            public String version;
091            public long size;
092    }