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.JournalFeed;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing JournalFeed in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see JournalFeed
032     * @generated
033     */
034    public class JournalFeedCacheModel implements CacheModel<JournalFeed>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(47);
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(", feedId=");
057                    sb.append(feedId);
058                    sb.append(", name=");
059                    sb.append(name);
060                    sb.append(", description=");
061                    sb.append(description);
062                    sb.append(", type=");
063                    sb.append(type);
064                    sb.append(", structureId=");
065                    sb.append(structureId);
066                    sb.append(", templateId=");
067                    sb.append(templateId);
068                    sb.append(", rendererTemplateId=");
069                    sb.append(rendererTemplateId);
070                    sb.append(", delta=");
071                    sb.append(delta);
072                    sb.append(", orderByCol=");
073                    sb.append(orderByCol);
074                    sb.append(", orderByType=");
075                    sb.append(orderByType);
076                    sb.append(", targetLayoutFriendlyUrl=");
077                    sb.append(targetLayoutFriendlyUrl);
078                    sb.append(", targetPortletId=");
079                    sb.append(targetPortletId);
080                    sb.append(", contentField=");
081                    sb.append(contentField);
082                    sb.append(", feedType=");
083                    sb.append(feedType);
084                    sb.append(", feedVersion=");
085                    sb.append(feedVersion);
086                    sb.append("}");
087    
088                    return sb.toString();
089            }
090    
091            public JournalFeed toEntityModel() {
092                    JournalFeedImpl journalFeedImpl = new JournalFeedImpl();
093    
094                    if (uuid == null) {
095                            journalFeedImpl.setUuid(StringPool.BLANK);
096                    }
097                    else {
098                            journalFeedImpl.setUuid(uuid);
099                    }
100    
101                    journalFeedImpl.setId(id);
102                    journalFeedImpl.setGroupId(groupId);
103                    journalFeedImpl.setCompanyId(companyId);
104                    journalFeedImpl.setUserId(userId);
105    
106                    if (userName == null) {
107                            journalFeedImpl.setUserName(StringPool.BLANK);
108                    }
109                    else {
110                            journalFeedImpl.setUserName(userName);
111                    }
112    
113                    if (createDate == Long.MIN_VALUE) {
114                            journalFeedImpl.setCreateDate(null);
115                    }
116                    else {
117                            journalFeedImpl.setCreateDate(new Date(createDate));
118                    }
119    
120                    if (modifiedDate == Long.MIN_VALUE) {
121                            journalFeedImpl.setModifiedDate(null);
122                    }
123                    else {
124                            journalFeedImpl.setModifiedDate(new Date(modifiedDate));
125                    }
126    
127                    if (feedId == null) {
128                            journalFeedImpl.setFeedId(StringPool.BLANK);
129                    }
130                    else {
131                            journalFeedImpl.setFeedId(feedId);
132                    }
133    
134                    if (name == null) {
135                            journalFeedImpl.setName(StringPool.BLANK);
136                    }
137                    else {
138                            journalFeedImpl.setName(name);
139                    }
140    
141                    if (description == null) {
142                            journalFeedImpl.setDescription(StringPool.BLANK);
143                    }
144                    else {
145                            journalFeedImpl.setDescription(description);
146                    }
147    
148                    if (type == null) {
149                            journalFeedImpl.setType(StringPool.BLANK);
150                    }
151                    else {
152                            journalFeedImpl.setType(type);
153                    }
154    
155                    if (structureId == null) {
156                            journalFeedImpl.setStructureId(StringPool.BLANK);
157                    }
158                    else {
159                            journalFeedImpl.setStructureId(structureId);
160                    }
161    
162                    if (templateId == null) {
163                            journalFeedImpl.setTemplateId(StringPool.BLANK);
164                    }
165                    else {
166                            journalFeedImpl.setTemplateId(templateId);
167                    }
168    
169                    if (rendererTemplateId == null) {
170                            journalFeedImpl.setRendererTemplateId(StringPool.BLANK);
171                    }
172                    else {
173                            journalFeedImpl.setRendererTemplateId(rendererTemplateId);
174                    }
175    
176                    journalFeedImpl.setDelta(delta);
177    
178                    if (orderByCol == null) {
179                            journalFeedImpl.setOrderByCol(StringPool.BLANK);
180                    }
181                    else {
182                            journalFeedImpl.setOrderByCol(orderByCol);
183                    }
184    
185                    if (orderByType == null) {
186                            journalFeedImpl.setOrderByType(StringPool.BLANK);
187                    }
188                    else {
189                            journalFeedImpl.setOrderByType(orderByType);
190                    }
191    
192                    if (targetLayoutFriendlyUrl == null) {
193                            journalFeedImpl.setTargetLayoutFriendlyUrl(StringPool.BLANK);
194                    }
195                    else {
196                            journalFeedImpl.setTargetLayoutFriendlyUrl(targetLayoutFriendlyUrl);
197                    }
198    
199                    if (targetPortletId == null) {
200                            journalFeedImpl.setTargetPortletId(StringPool.BLANK);
201                    }
202                    else {
203                            journalFeedImpl.setTargetPortletId(targetPortletId);
204                    }
205    
206                    if (contentField == null) {
207                            journalFeedImpl.setContentField(StringPool.BLANK);
208                    }
209                    else {
210                            journalFeedImpl.setContentField(contentField);
211                    }
212    
213                    if (feedType == null) {
214                            journalFeedImpl.setFeedType(StringPool.BLANK);
215                    }
216                    else {
217                            journalFeedImpl.setFeedType(feedType);
218                    }
219    
220                    journalFeedImpl.setFeedVersion(feedVersion);
221    
222                    journalFeedImpl.resetOriginalValues();
223    
224                    return journalFeedImpl;
225            }
226    
227            public String uuid;
228            public long id;
229            public long groupId;
230            public long companyId;
231            public long userId;
232            public String userName;
233            public long createDate;
234            public long modifiedDate;
235            public String feedId;
236            public String name;
237            public String description;
238            public String type;
239            public String structureId;
240            public String templateId;
241            public String rendererTemplateId;
242            public int delta;
243            public String orderByCol;
244            public String orderByType;
245            public String targetLayoutFriendlyUrl;
246            public String targetPortletId;
247            public String contentField;
248            public String feedType;
249            public double feedVersion;
250    }