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.journal.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.journal.model.JournalTemplate;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing JournalTemplate in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see JournalTemplate
032     * @generated
033     */
034    public class JournalTemplateCacheModel implements CacheModel<JournalTemplate>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(37);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", id=");
043                    sb.append(id);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", companyId=");
047                    sb.append(companyId);
048                    sb.append(", userId=");
049                    sb.append(userId);
050                    sb.append(", userName=");
051                    sb.append(userName);
052                    sb.append(", createDate=");
053                    sb.append(createDate);
054                    sb.append(", modifiedDate=");
055                    sb.append(modifiedDate);
056                    sb.append(", templateId=");
057                    sb.append(templateId);
058                    sb.append(", structureId=");
059                    sb.append(structureId);
060                    sb.append(", name=");
061                    sb.append(name);
062                    sb.append(", description=");
063                    sb.append(description);
064                    sb.append(", xsl=");
065                    sb.append(xsl);
066                    sb.append(", langType=");
067                    sb.append(langType);
068                    sb.append(", cacheable=");
069                    sb.append(cacheable);
070                    sb.append(", smallImage=");
071                    sb.append(smallImage);
072                    sb.append(", smallImageId=");
073                    sb.append(smallImageId);
074                    sb.append(", smallImageURL=");
075                    sb.append(smallImageURL);
076                    sb.append("}");
077    
078                    return sb.toString();
079            }
080    
081            public JournalTemplate toEntityModel() {
082                    JournalTemplateImpl journalTemplateImpl = new JournalTemplateImpl();
083    
084                    if (uuid == null) {
085                            journalTemplateImpl.setUuid(StringPool.BLANK);
086                    }
087                    else {
088                            journalTemplateImpl.setUuid(uuid);
089                    }
090    
091                    journalTemplateImpl.setId(id);
092                    journalTemplateImpl.setGroupId(groupId);
093                    journalTemplateImpl.setCompanyId(companyId);
094                    journalTemplateImpl.setUserId(userId);
095    
096                    if (userName == null) {
097                            journalTemplateImpl.setUserName(StringPool.BLANK);
098                    }
099                    else {
100                            journalTemplateImpl.setUserName(userName);
101                    }
102    
103                    if (createDate == Long.MIN_VALUE) {
104                            journalTemplateImpl.setCreateDate(null);
105                    }
106                    else {
107                            journalTemplateImpl.setCreateDate(new Date(createDate));
108                    }
109    
110                    if (modifiedDate == Long.MIN_VALUE) {
111                            journalTemplateImpl.setModifiedDate(null);
112                    }
113                    else {
114                            journalTemplateImpl.setModifiedDate(new Date(modifiedDate));
115                    }
116    
117                    if (templateId == null) {
118                            journalTemplateImpl.setTemplateId(StringPool.BLANK);
119                    }
120                    else {
121                            journalTemplateImpl.setTemplateId(templateId);
122                    }
123    
124                    if (structureId == null) {
125                            journalTemplateImpl.setStructureId(StringPool.BLANK);
126                    }
127                    else {
128                            journalTemplateImpl.setStructureId(structureId);
129                    }
130    
131                    if (name == null) {
132                            journalTemplateImpl.setName(StringPool.BLANK);
133                    }
134                    else {
135                            journalTemplateImpl.setName(name);
136                    }
137    
138                    if (description == null) {
139                            journalTemplateImpl.setDescription(StringPool.BLANK);
140                    }
141                    else {
142                            journalTemplateImpl.setDescription(description);
143                    }
144    
145                    if (xsl == null) {
146                            journalTemplateImpl.setXsl(StringPool.BLANK);
147                    }
148                    else {
149                            journalTemplateImpl.setXsl(xsl);
150                    }
151    
152                    if (langType == null) {
153                            journalTemplateImpl.setLangType(StringPool.BLANK);
154                    }
155                    else {
156                            journalTemplateImpl.setLangType(langType);
157                    }
158    
159                    journalTemplateImpl.setCacheable(cacheable);
160                    journalTemplateImpl.setSmallImage(smallImage);
161                    journalTemplateImpl.setSmallImageId(smallImageId);
162    
163                    if (smallImageURL == null) {
164                            journalTemplateImpl.setSmallImageURL(StringPool.BLANK);
165                    }
166                    else {
167                            journalTemplateImpl.setSmallImageURL(smallImageURL);
168                    }
169    
170                    journalTemplateImpl.resetOriginalValues();
171    
172                    return journalTemplateImpl;
173            }
174    
175            public String uuid;
176            public long id;
177            public long groupId;
178            public long companyId;
179            public long userId;
180            public String userName;
181            public long createDate;
182            public long modifiedDate;
183            public String templateId;
184            public String structureId;
185            public String name;
186            public String description;
187            public String xsl;
188            public String langType;
189            public boolean cacheable;
190            public boolean smallImage;
191            public long smallImageId;
192            public String smallImageURL;
193    }