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.SCFrameworkVersion;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing SCFrameworkVersion in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see SCFrameworkVersion
032     * @generated
033     */
034    public class SCFrameworkVersionCacheModel implements CacheModel<SCFrameworkVersion>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(23);
039    
040                    sb.append("{frameworkVersionId=");
041                    sb.append(frameworkVersionId);
042                    sb.append(", groupId=");
043                    sb.append(groupId);
044                    sb.append(", companyId=");
045                    sb.append(companyId);
046                    sb.append(", userId=");
047                    sb.append(userId);
048                    sb.append(", userName=");
049                    sb.append(userName);
050                    sb.append(", createDate=");
051                    sb.append(createDate);
052                    sb.append(", modifiedDate=");
053                    sb.append(modifiedDate);
054                    sb.append(", name=");
055                    sb.append(name);
056                    sb.append(", url=");
057                    sb.append(url);
058                    sb.append(", active=");
059                    sb.append(active);
060                    sb.append(", priority=");
061                    sb.append(priority);
062                    sb.append("}");
063    
064                    return sb.toString();
065            }
066    
067            public SCFrameworkVersion toEntityModel() {
068                    SCFrameworkVersionImpl scFrameworkVersionImpl = new SCFrameworkVersionImpl();
069    
070                    scFrameworkVersionImpl.setFrameworkVersionId(frameworkVersionId);
071                    scFrameworkVersionImpl.setGroupId(groupId);
072                    scFrameworkVersionImpl.setCompanyId(companyId);
073                    scFrameworkVersionImpl.setUserId(userId);
074    
075                    if (userName == null) {
076                            scFrameworkVersionImpl.setUserName(StringPool.BLANK);
077                    }
078                    else {
079                            scFrameworkVersionImpl.setUserName(userName);
080                    }
081    
082                    if (createDate == Long.MIN_VALUE) {
083                            scFrameworkVersionImpl.setCreateDate(null);
084                    }
085                    else {
086                            scFrameworkVersionImpl.setCreateDate(new Date(createDate));
087                    }
088    
089                    if (modifiedDate == Long.MIN_VALUE) {
090                            scFrameworkVersionImpl.setModifiedDate(null);
091                    }
092                    else {
093                            scFrameworkVersionImpl.setModifiedDate(new Date(modifiedDate));
094                    }
095    
096                    if (name == null) {
097                            scFrameworkVersionImpl.setName(StringPool.BLANK);
098                    }
099                    else {
100                            scFrameworkVersionImpl.setName(name);
101                    }
102    
103                    if (url == null) {
104                            scFrameworkVersionImpl.setUrl(StringPool.BLANK);
105                    }
106                    else {
107                            scFrameworkVersionImpl.setUrl(url);
108                    }
109    
110                    scFrameworkVersionImpl.setActive(active);
111                    scFrameworkVersionImpl.setPriority(priority);
112    
113                    scFrameworkVersionImpl.resetOriginalValues();
114    
115                    return scFrameworkVersionImpl;
116            }
117    
118            public long frameworkVersionId;
119            public long groupId;
120            public long companyId;
121            public long userId;
122            public String userName;
123            public long createDate;
124            public long modifiedDate;
125            public String name;
126            public String url;
127            public boolean active;
128            public int priority;
129    }