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.blogs.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.blogs.model.BlogsEntry;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing BlogsEntry in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see BlogsEntry
032     * @generated
033     */
034    public class BlogsEntryCacheModel implements CacheModel<BlogsEntry>,
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(", entryId=");
043                    sb.append(entryId);
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(", title=");
057                    sb.append(title);
058                    sb.append(", urlTitle=");
059                    sb.append(urlTitle);
060                    sb.append(", description=");
061                    sb.append(description);
062                    sb.append(", content=");
063                    sb.append(content);
064                    sb.append(", displayDate=");
065                    sb.append(displayDate);
066                    sb.append(", allowPingbacks=");
067                    sb.append(allowPingbacks);
068                    sb.append(", allowTrackbacks=");
069                    sb.append(allowTrackbacks);
070                    sb.append(", trackbacks=");
071                    sb.append(trackbacks);
072                    sb.append(", smallImage=");
073                    sb.append(smallImage);
074                    sb.append(", smallImageId=");
075                    sb.append(smallImageId);
076                    sb.append(", smallImageURL=");
077                    sb.append(smallImageURL);
078                    sb.append(", status=");
079                    sb.append(status);
080                    sb.append(", statusByUserId=");
081                    sb.append(statusByUserId);
082                    sb.append(", statusByUserName=");
083                    sb.append(statusByUserName);
084                    sb.append(", statusDate=");
085                    sb.append(statusDate);
086                    sb.append("}");
087    
088                    return sb.toString();
089            }
090    
091            public BlogsEntry toEntityModel() {
092                    BlogsEntryImpl blogsEntryImpl = new BlogsEntryImpl();
093    
094                    if (uuid == null) {
095                            blogsEntryImpl.setUuid(StringPool.BLANK);
096                    }
097                    else {
098                            blogsEntryImpl.setUuid(uuid);
099                    }
100    
101                    blogsEntryImpl.setEntryId(entryId);
102                    blogsEntryImpl.setGroupId(groupId);
103                    blogsEntryImpl.setCompanyId(companyId);
104                    blogsEntryImpl.setUserId(userId);
105    
106                    if (userName == null) {
107                            blogsEntryImpl.setUserName(StringPool.BLANK);
108                    }
109                    else {
110                            blogsEntryImpl.setUserName(userName);
111                    }
112    
113                    if (createDate == Long.MIN_VALUE) {
114                            blogsEntryImpl.setCreateDate(null);
115                    }
116                    else {
117                            blogsEntryImpl.setCreateDate(new Date(createDate));
118                    }
119    
120                    if (modifiedDate == Long.MIN_VALUE) {
121                            blogsEntryImpl.setModifiedDate(null);
122                    }
123                    else {
124                            blogsEntryImpl.setModifiedDate(new Date(modifiedDate));
125                    }
126    
127                    if (title == null) {
128                            blogsEntryImpl.setTitle(StringPool.BLANK);
129                    }
130                    else {
131                            blogsEntryImpl.setTitle(title);
132                    }
133    
134                    if (urlTitle == null) {
135                            blogsEntryImpl.setUrlTitle(StringPool.BLANK);
136                    }
137                    else {
138                            blogsEntryImpl.setUrlTitle(urlTitle);
139                    }
140    
141                    if (description == null) {
142                            blogsEntryImpl.setDescription(StringPool.BLANK);
143                    }
144                    else {
145                            blogsEntryImpl.setDescription(description);
146                    }
147    
148                    if (content == null) {
149                            blogsEntryImpl.setContent(StringPool.BLANK);
150                    }
151                    else {
152                            blogsEntryImpl.setContent(content);
153                    }
154    
155                    if (displayDate == Long.MIN_VALUE) {
156                            blogsEntryImpl.setDisplayDate(null);
157                    }
158                    else {
159                            blogsEntryImpl.setDisplayDate(new Date(displayDate));
160                    }
161    
162                    blogsEntryImpl.setAllowPingbacks(allowPingbacks);
163                    blogsEntryImpl.setAllowTrackbacks(allowTrackbacks);
164    
165                    if (trackbacks == null) {
166                            blogsEntryImpl.setTrackbacks(StringPool.BLANK);
167                    }
168                    else {
169                            blogsEntryImpl.setTrackbacks(trackbacks);
170                    }
171    
172                    blogsEntryImpl.setSmallImage(smallImage);
173                    blogsEntryImpl.setSmallImageId(smallImageId);
174    
175                    if (smallImageURL == null) {
176                            blogsEntryImpl.setSmallImageURL(StringPool.BLANK);
177                    }
178                    else {
179                            blogsEntryImpl.setSmallImageURL(smallImageURL);
180                    }
181    
182                    blogsEntryImpl.setStatus(status);
183                    blogsEntryImpl.setStatusByUserId(statusByUserId);
184    
185                    if (statusByUserName == null) {
186                            blogsEntryImpl.setStatusByUserName(StringPool.BLANK);
187                    }
188                    else {
189                            blogsEntryImpl.setStatusByUserName(statusByUserName);
190                    }
191    
192                    if (statusDate == Long.MIN_VALUE) {
193                            blogsEntryImpl.setStatusDate(null);
194                    }
195                    else {
196                            blogsEntryImpl.setStatusDate(new Date(statusDate));
197                    }
198    
199                    blogsEntryImpl.resetOriginalValues();
200    
201                    return blogsEntryImpl;
202            }
203    
204            public String uuid;
205            public long entryId;
206            public long groupId;
207            public long companyId;
208            public long userId;
209            public String userName;
210            public long createDate;
211            public long modifiedDate;
212            public String title;
213            public String urlTitle;
214            public String description;
215            public String content;
216            public long displayDate;
217            public boolean allowPingbacks;
218            public boolean allowTrackbacks;
219            public String trackbacks;
220            public boolean smallImage;
221            public long smallImageId;
222            public String smallImageURL;
223            public int status;
224            public long statusByUserId;
225            public String statusByUserName;
226            public long statusDate;
227    }