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.LayoutSetPrototype;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing LayoutSetPrototype in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see LayoutSetPrototype
031     * @generated
032     */
033    public class LayoutSetPrototypeCacheModel implements CacheModel<LayoutSetPrototype>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(19);
038    
039                    sb.append("{uuid=");
040                    sb.append(uuid);
041                    sb.append(", layoutSetPrototypeId=");
042                    sb.append(layoutSetPrototypeId);
043                    sb.append(", companyId=");
044                    sb.append(companyId);
045                    sb.append(", createDate=");
046                    sb.append(createDate);
047                    sb.append(", modifiedDate=");
048                    sb.append(modifiedDate);
049                    sb.append(", name=");
050                    sb.append(name);
051                    sb.append(", description=");
052                    sb.append(description);
053                    sb.append(", settings=");
054                    sb.append(settings);
055                    sb.append(", active=");
056                    sb.append(active);
057                    sb.append("}");
058    
059                    return sb.toString();
060            }
061    
062            public LayoutSetPrototype toEntityModel() {
063                    LayoutSetPrototypeImpl layoutSetPrototypeImpl = new LayoutSetPrototypeImpl();
064    
065                    if (uuid == null) {
066                            layoutSetPrototypeImpl.setUuid(StringPool.BLANK);
067                    }
068                    else {
069                            layoutSetPrototypeImpl.setUuid(uuid);
070                    }
071    
072                    layoutSetPrototypeImpl.setLayoutSetPrototypeId(layoutSetPrototypeId);
073                    layoutSetPrototypeImpl.setCompanyId(companyId);
074    
075                    if (createDate == Long.MIN_VALUE) {
076                            layoutSetPrototypeImpl.setCreateDate(null);
077                    }
078                    else {
079                            layoutSetPrototypeImpl.setCreateDate(new Date(createDate));
080                    }
081    
082                    if (modifiedDate == Long.MIN_VALUE) {
083                            layoutSetPrototypeImpl.setModifiedDate(null);
084                    }
085                    else {
086                            layoutSetPrototypeImpl.setModifiedDate(new Date(modifiedDate));
087                    }
088    
089                    if (name == null) {
090                            layoutSetPrototypeImpl.setName(StringPool.BLANK);
091                    }
092                    else {
093                            layoutSetPrototypeImpl.setName(name);
094                    }
095    
096                    if (description == null) {
097                            layoutSetPrototypeImpl.setDescription(StringPool.BLANK);
098                    }
099                    else {
100                            layoutSetPrototypeImpl.setDescription(description);
101                    }
102    
103                    if (settings == null) {
104                            layoutSetPrototypeImpl.setSettings(StringPool.BLANK);
105                    }
106                    else {
107                            layoutSetPrototypeImpl.setSettings(settings);
108                    }
109    
110                    layoutSetPrototypeImpl.setActive(active);
111    
112                    layoutSetPrototypeImpl.resetOriginalValues();
113    
114                    return layoutSetPrototypeImpl;
115            }
116    
117            public String uuid;
118            public long layoutSetPrototypeId;
119            public long companyId;
120            public long createDate;
121            public long modifiedDate;
122            public String name;
123            public String description;
124            public String settings;
125            public boolean active;
126    }