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.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(19);
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(", state=");
053                    sb.append(state);
054                    sb.append(", testString=");
055                    sb.append(testString);
056                    sb.append("}");
057    
058                    return sb.toString();
059            }
060    
061            public Release toEntityModel() {
062                    ReleaseImpl releaseImpl = new ReleaseImpl();
063    
064                    releaseImpl.setReleaseId(releaseId);
065    
066                    if (createDate == Long.MIN_VALUE) {
067                            releaseImpl.setCreateDate(null);
068                    }
069                    else {
070                            releaseImpl.setCreateDate(new Date(createDate));
071                    }
072    
073                    if (modifiedDate == Long.MIN_VALUE) {
074                            releaseImpl.setModifiedDate(null);
075                    }
076                    else {
077                            releaseImpl.setModifiedDate(new Date(modifiedDate));
078                    }
079    
080                    if (servletContextName == null) {
081                            releaseImpl.setServletContextName(StringPool.BLANK);
082                    }
083                    else {
084                            releaseImpl.setServletContextName(servletContextName);
085                    }
086    
087                    releaseImpl.setBuildNumber(buildNumber);
088    
089                    if (buildDate == Long.MIN_VALUE) {
090                            releaseImpl.setBuildDate(null);
091                    }
092                    else {
093                            releaseImpl.setBuildDate(new Date(buildDate));
094                    }
095    
096                    releaseImpl.setVerified(verified);
097                    releaseImpl.setState(state);
098    
099                    if (testString == null) {
100                            releaseImpl.setTestString(StringPool.BLANK);
101                    }
102                    else {
103                            releaseImpl.setTestString(testString);
104                    }
105    
106                    releaseImpl.resetOriginalValues();
107    
108                    return releaseImpl;
109            }
110    
111            public long releaseId;
112            public long createDate;
113            public long modifiedDate;
114            public String servletContextName;
115            public int buildNumber;
116            public long buildDate;
117            public boolean verified;
118            public int state;
119            public String testString;
120    }