001    /**
002     * Copyright (c) 2000-2012 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.portal.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    import com.liferay.portal.model.Release;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing Release in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see Release
031     * @generated
032     */
033    public class ReleaseCacheModel implements CacheModel<Release>, Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(17);
037    
038                    sb.append("{releaseId=");
039                    sb.append(releaseId);
040                    sb.append(", createDate=");
041                    sb.append(createDate);
042                    sb.append(", modifiedDate=");
043                    sb.append(modifiedDate);
044                    sb.append(", servletContextName=");
045                    sb.append(servletContextName);
046                    sb.append(", buildNumber=");
047                    sb.append(buildNumber);
048                    sb.append(", buildDate=");
049                    sb.append(buildDate);
050                    sb.append(", verified=");
051                    sb.append(verified);
052                    sb.append(", testString=");
053                    sb.append(testString);
054                    sb.append("}");
055    
056                    return sb.toString();
057            }
058    
059            public Release toEntityModel() {
060                    ReleaseImpl releaseImpl = new ReleaseImpl();
061    
062                    releaseImpl.setReleaseId(releaseId);
063    
064                    if (createDate == Long.MIN_VALUE) {
065                            releaseImpl.setCreateDate(null);
066                    }
067                    else {
068                            releaseImpl.setCreateDate(new Date(createDate));
069                    }
070    
071                    if (modifiedDate == Long.MIN_VALUE) {
072                            releaseImpl.setModifiedDate(null);
073                    }
074                    else {
075                            releaseImpl.setModifiedDate(new Date(modifiedDate));
076                    }
077    
078                    if (servletContextName == null) {
079                            releaseImpl.setServletContextName(StringPool.BLANK);
080                    }
081                    else {
082                            releaseImpl.setServletContextName(servletContextName);
083                    }
084    
085                    releaseImpl.setBuildNumber(buildNumber);
086    
087                    if (buildDate == Long.MIN_VALUE) {
088                            releaseImpl.setBuildDate(null);
089                    }
090                    else {
091                            releaseImpl.setBuildDate(new Date(buildDate));
092                    }
093    
094                    releaseImpl.setVerified(verified);
095    
096                    if (testString == null) {
097                            releaseImpl.setTestString(StringPool.BLANK);
098                    }
099                    else {
100                            releaseImpl.setTestString(testString);
101                    }
102    
103                    releaseImpl.resetOriginalValues();
104    
105                    return releaseImpl;
106            }
107    
108            public long releaseId;
109            public long createDate;
110            public long modifiedDate;
111            public String servletContextName;
112            public int buildNumber;
113            public long buildDate;
114            public boolean verified;
115            public String testString;
116    }