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.softwarecatalog.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.softwarecatalog.model.SCProductVersion;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing SCProductVersion in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see SCProductVersion
032     * @generated
033     */
034    public class SCProductVersionCacheModel implements CacheModel<SCProductVersion>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(25);
039    
040                    sb.append("{productVersionId=");
041                    sb.append(productVersionId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", userId=");
045                    sb.append(userId);
046                    sb.append(", userName=");
047                    sb.append(userName);
048                    sb.append(", createDate=");
049                    sb.append(createDate);
050                    sb.append(", modifiedDate=");
051                    sb.append(modifiedDate);
052                    sb.append(", productEntryId=");
053                    sb.append(productEntryId);
054                    sb.append(", version=");
055                    sb.append(version);
056                    sb.append(", changeLog=");
057                    sb.append(changeLog);
058                    sb.append(", downloadPageURL=");
059                    sb.append(downloadPageURL);
060                    sb.append(", directDownloadURL=");
061                    sb.append(directDownloadURL);
062                    sb.append(", repoStoreArtifact=");
063                    sb.append(repoStoreArtifact);
064                    sb.append("}");
065    
066                    return sb.toString();
067            }
068    
069            public SCProductVersion toEntityModel() {
070                    SCProductVersionImpl scProductVersionImpl = new SCProductVersionImpl();
071    
072                    scProductVersionImpl.setProductVersionId(productVersionId);
073                    scProductVersionImpl.setCompanyId(companyId);
074                    scProductVersionImpl.setUserId(userId);
075    
076                    if (userName == null) {
077                            scProductVersionImpl.setUserName(StringPool.BLANK);
078                    }
079                    else {
080                            scProductVersionImpl.setUserName(userName);
081                    }
082    
083                    if (createDate == Long.MIN_VALUE) {
084                            scProductVersionImpl.setCreateDate(null);
085                    }
086                    else {
087                            scProductVersionImpl.setCreateDate(new Date(createDate));
088                    }
089    
090                    if (modifiedDate == Long.MIN_VALUE) {
091                            scProductVersionImpl.setModifiedDate(null);
092                    }
093                    else {
094                            scProductVersionImpl.setModifiedDate(new Date(modifiedDate));
095                    }
096    
097                    scProductVersionImpl.setProductEntryId(productEntryId);
098    
099                    if (version == null) {
100                            scProductVersionImpl.setVersion(StringPool.BLANK);
101                    }
102                    else {
103                            scProductVersionImpl.setVersion(version);
104                    }
105    
106                    if (changeLog == null) {
107                            scProductVersionImpl.setChangeLog(StringPool.BLANK);
108                    }
109                    else {
110                            scProductVersionImpl.setChangeLog(changeLog);
111                    }
112    
113                    if (downloadPageURL == null) {
114                            scProductVersionImpl.setDownloadPageURL(StringPool.BLANK);
115                    }
116                    else {
117                            scProductVersionImpl.setDownloadPageURL(downloadPageURL);
118                    }
119    
120                    if (directDownloadURL == null) {
121                            scProductVersionImpl.setDirectDownloadURL(StringPool.BLANK);
122                    }
123                    else {
124                            scProductVersionImpl.setDirectDownloadURL(directDownloadURL);
125                    }
126    
127                    scProductVersionImpl.setRepoStoreArtifact(repoStoreArtifact);
128    
129                    scProductVersionImpl.resetOriginalValues();
130    
131                    return scProductVersionImpl;
132            }
133    
134            public long productVersionId;
135            public long companyId;
136            public long userId;
137            public String userName;
138            public long createDate;
139            public long modifiedDate;
140            public long productEntryId;
141            public String version;
142            public String changeLog;
143            public String downloadPageURL;
144            public String directDownloadURL;
145            public boolean repoStoreArtifact;
146    }