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.SCLicense;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing SCLicense in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see SCLicense
030     * @generated
031     */
032    public class SCLicenseCacheModel implements CacheModel<SCLicense>, Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(13);
036    
037                    sb.append("{licenseId=");
038                    sb.append(licenseId);
039                    sb.append(", name=");
040                    sb.append(name);
041                    sb.append(", url=");
042                    sb.append(url);
043                    sb.append(", openSource=");
044                    sb.append(openSource);
045                    sb.append(", active=");
046                    sb.append(active);
047                    sb.append(", recommended=");
048                    sb.append(recommended);
049                    sb.append("}");
050    
051                    return sb.toString();
052            }
053    
054            public SCLicense toEntityModel() {
055                    SCLicenseImpl scLicenseImpl = new SCLicenseImpl();
056    
057                    scLicenseImpl.setLicenseId(licenseId);
058    
059                    if (name == null) {
060                            scLicenseImpl.setName(StringPool.BLANK);
061                    }
062                    else {
063                            scLicenseImpl.setName(name);
064                    }
065    
066                    if (url == null) {
067                            scLicenseImpl.setUrl(StringPool.BLANK);
068                    }
069                    else {
070                            scLicenseImpl.setUrl(url);
071                    }
072    
073                    scLicenseImpl.setOpenSource(openSource);
074                    scLicenseImpl.setActive(active);
075                    scLicenseImpl.setRecommended(recommended);
076    
077                    scLicenseImpl.resetOriginalValues();
078    
079                    return scLicenseImpl;
080            }
081    
082            public long licenseId;
083            public String name;
084            public String url;
085            public boolean openSource;
086            public boolean active;
087            public boolean recommended;
088    }