001
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
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 }