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.messageboards.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.messageboards.model.MBMailingList;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing MBMailingList in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBMailingList
032     * @generated
033     */
034    public class MBMailingListCacheModel implements CacheModel<MBMailingList>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(53);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", mailingListId=");
043                    sb.append(mailingListId);
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(", categoryId=");
057                    sb.append(categoryId);
058                    sb.append(", emailAddress=");
059                    sb.append(emailAddress);
060                    sb.append(", inProtocol=");
061                    sb.append(inProtocol);
062                    sb.append(", inServerName=");
063                    sb.append(inServerName);
064                    sb.append(", inServerPort=");
065                    sb.append(inServerPort);
066                    sb.append(", inUseSSL=");
067                    sb.append(inUseSSL);
068                    sb.append(", inUserName=");
069                    sb.append(inUserName);
070                    sb.append(", inPassword=");
071                    sb.append(inPassword);
072                    sb.append(", inReadInterval=");
073                    sb.append(inReadInterval);
074                    sb.append(", outEmailAddress=");
075                    sb.append(outEmailAddress);
076                    sb.append(", outCustom=");
077                    sb.append(outCustom);
078                    sb.append(", outServerName=");
079                    sb.append(outServerName);
080                    sb.append(", outServerPort=");
081                    sb.append(outServerPort);
082                    sb.append(", outUseSSL=");
083                    sb.append(outUseSSL);
084                    sb.append(", outUserName=");
085                    sb.append(outUserName);
086                    sb.append(", outPassword=");
087                    sb.append(outPassword);
088                    sb.append(", allowAnonymous=");
089                    sb.append(allowAnonymous);
090                    sb.append(", active=");
091                    sb.append(active);
092                    sb.append("}");
093    
094                    return sb.toString();
095            }
096    
097            public MBMailingList toEntityModel() {
098                    MBMailingListImpl mbMailingListImpl = new MBMailingListImpl();
099    
100                    if (uuid == null) {
101                            mbMailingListImpl.setUuid(StringPool.BLANK);
102                    }
103                    else {
104                            mbMailingListImpl.setUuid(uuid);
105                    }
106    
107                    mbMailingListImpl.setMailingListId(mailingListId);
108                    mbMailingListImpl.setGroupId(groupId);
109                    mbMailingListImpl.setCompanyId(companyId);
110                    mbMailingListImpl.setUserId(userId);
111    
112                    if (userName == null) {
113                            mbMailingListImpl.setUserName(StringPool.BLANK);
114                    }
115                    else {
116                            mbMailingListImpl.setUserName(userName);
117                    }
118    
119                    if (createDate == Long.MIN_VALUE) {
120                            mbMailingListImpl.setCreateDate(null);
121                    }
122                    else {
123                            mbMailingListImpl.setCreateDate(new Date(createDate));
124                    }
125    
126                    if (modifiedDate == Long.MIN_VALUE) {
127                            mbMailingListImpl.setModifiedDate(null);
128                    }
129                    else {
130                            mbMailingListImpl.setModifiedDate(new Date(modifiedDate));
131                    }
132    
133                    mbMailingListImpl.setCategoryId(categoryId);
134    
135                    if (emailAddress == null) {
136                            mbMailingListImpl.setEmailAddress(StringPool.BLANK);
137                    }
138                    else {
139                            mbMailingListImpl.setEmailAddress(emailAddress);
140                    }
141    
142                    if (inProtocol == null) {
143                            mbMailingListImpl.setInProtocol(StringPool.BLANK);
144                    }
145                    else {
146                            mbMailingListImpl.setInProtocol(inProtocol);
147                    }
148    
149                    if (inServerName == null) {
150                            mbMailingListImpl.setInServerName(StringPool.BLANK);
151                    }
152                    else {
153                            mbMailingListImpl.setInServerName(inServerName);
154                    }
155    
156                    mbMailingListImpl.setInServerPort(inServerPort);
157                    mbMailingListImpl.setInUseSSL(inUseSSL);
158    
159                    if (inUserName == null) {
160                            mbMailingListImpl.setInUserName(StringPool.BLANK);
161                    }
162                    else {
163                            mbMailingListImpl.setInUserName(inUserName);
164                    }
165    
166                    if (inPassword == null) {
167                            mbMailingListImpl.setInPassword(StringPool.BLANK);
168                    }
169                    else {
170                            mbMailingListImpl.setInPassword(inPassword);
171                    }
172    
173                    mbMailingListImpl.setInReadInterval(inReadInterval);
174    
175                    if (outEmailAddress == null) {
176                            mbMailingListImpl.setOutEmailAddress(StringPool.BLANK);
177                    }
178                    else {
179                            mbMailingListImpl.setOutEmailAddress(outEmailAddress);
180                    }
181    
182                    mbMailingListImpl.setOutCustom(outCustom);
183    
184                    if (outServerName == null) {
185                            mbMailingListImpl.setOutServerName(StringPool.BLANK);
186                    }
187                    else {
188                            mbMailingListImpl.setOutServerName(outServerName);
189                    }
190    
191                    mbMailingListImpl.setOutServerPort(outServerPort);
192                    mbMailingListImpl.setOutUseSSL(outUseSSL);
193    
194                    if (outUserName == null) {
195                            mbMailingListImpl.setOutUserName(StringPool.BLANK);
196                    }
197                    else {
198                            mbMailingListImpl.setOutUserName(outUserName);
199                    }
200    
201                    if (outPassword == null) {
202                            mbMailingListImpl.setOutPassword(StringPool.BLANK);
203                    }
204                    else {
205                            mbMailingListImpl.setOutPassword(outPassword);
206                    }
207    
208                    mbMailingListImpl.setAllowAnonymous(allowAnonymous);
209                    mbMailingListImpl.setActive(active);
210    
211                    mbMailingListImpl.resetOriginalValues();
212    
213                    return mbMailingListImpl;
214            }
215    
216            public String uuid;
217            public long mailingListId;
218            public long groupId;
219            public long companyId;
220            public long userId;
221            public String userName;
222            public long createDate;
223            public long modifiedDate;
224            public long categoryId;
225            public String emailAddress;
226            public String inProtocol;
227            public String inServerName;
228            public int inServerPort;
229            public boolean inUseSSL;
230            public String inUserName;
231            public String inPassword;
232            public int inReadInterval;
233            public String outEmailAddress;
234            public boolean outCustom;
235            public String outServerName;
236            public int outServerPort;
237            public boolean outUseSSL;
238            public String outUserName;
239            public String outPassword;
240            public boolean allowAnonymous;
241            public boolean active;
242    }