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.LayoutPrototype;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing LayoutPrototype in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see LayoutPrototype
029     * @generated
030     */
031    public class LayoutPrototypeCacheModel implements CacheModel<LayoutPrototype>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(15);
036    
037                    sb.append("{uuid=");
038                    sb.append(uuid);
039                    sb.append(", layoutPrototypeId=");
040                    sb.append(layoutPrototypeId);
041                    sb.append(", companyId=");
042                    sb.append(companyId);
043                    sb.append(", name=");
044                    sb.append(name);
045                    sb.append(", description=");
046                    sb.append(description);
047                    sb.append(", settings=");
048                    sb.append(settings);
049                    sb.append(", active=");
050                    sb.append(active);
051                    sb.append("}");
052    
053                    return sb.toString();
054            }
055    
056            public LayoutPrototype toEntityModel() {
057                    LayoutPrototypeImpl layoutPrototypeImpl = new LayoutPrototypeImpl();
058    
059                    if (uuid == null) {
060                            layoutPrototypeImpl.setUuid(StringPool.BLANK);
061                    }
062                    else {
063                            layoutPrototypeImpl.setUuid(uuid);
064                    }
065    
066                    layoutPrototypeImpl.setLayoutPrototypeId(layoutPrototypeId);
067                    layoutPrototypeImpl.setCompanyId(companyId);
068    
069                    if (name == null) {
070                            layoutPrototypeImpl.setName(StringPool.BLANK);
071                    }
072                    else {
073                            layoutPrototypeImpl.setName(name);
074                    }
075    
076                    if (description == null) {
077                            layoutPrototypeImpl.setDescription(StringPool.BLANK);
078                    }
079                    else {
080                            layoutPrototypeImpl.setDescription(description);
081                    }
082    
083                    if (settings == null) {
084                            layoutPrototypeImpl.setSettings(StringPool.BLANK);
085                    }
086                    else {
087                            layoutPrototypeImpl.setSettings(settings);
088                    }
089    
090                    layoutPrototypeImpl.setActive(active);
091    
092                    layoutPrototypeImpl.resetOriginalValues();
093    
094                    return layoutPrototypeImpl;
095            }
096    
097            public String uuid;
098            public long layoutPrototypeId;
099            public long companyId;
100            public String name;
101            public String description;
102            public String settings;
103            public boolean active;
104    }