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.PluginSetting;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing PluginSetting in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see PluginSetting
029     * @generated
030     */
031    public class PluginSettingCacheModel implements CacheModel<PluginSetting>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(13);
036    
037                    sb.append("{pluginSettingId=");
038                    sb.append(pluginSettingId);
039                    sb.append(", companyId=");
040                    sb.append(companyId);
041                    sb.append(", pluginId=");
042                    sb.append(pluginId);
043                    sb.append(", pluginType=");
044                    sb.append(pluginType);
045                    sb.append(", roles=");
046                    sb.append(roles);
047                    sb.append(", active=");
048                    sb.append(active);
049                    sb.append("}");
050    
051                    return sb.toString();
052            }
053    
054            public PluginSetting toEntityModel() {
055                    PluginSettingImpl pluginSettingImpl = new PluginSettingImpl();
056    
057                    pluginSettingImpl.setPluginSettingId(pluginSettingId);
058                    pluginSettingImpl.setCompanyId(companyId);
059    
060                    if (pluginId == null) {
061                            pluginSettingImpl.setPluginId(StringPool.BLANK);
062                    }
063                    else {
064                            pluginSettingImpl.setPluginId(pluginId);
065                    }
066    
067                    if (pluginType == null) {
068                            pluginSettingImpl.setPluginType(StringPool.BLANK);
069                    }
070                    else {
071                            pluginSettingImpl.setPluginType(pluginType);
072                    }
073    
074                    if (roles == null) {
075                            pluginSettingImpl.setRoles(StringPool.BLANK);
076                    }
077                    else {
078                            pluginSettingImpl.setRoles(roles);
079                    }
080    
081                    pluginSettingImpl.setActive(active);
082    
083                    pluginSettingImpl.resetOriginalValues();
084    
085                    return pluginSettingImpl;
086            }
087    
088            public long pluginSettingId;
089            public long companyId;
090            public String pluginId;
091            public String pluginType;
092            public String roles;
093            public boolean active;
094    }