001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.CacheModel;
022    
023    import com.liferay.portlet.messageboards.model.MBMailingList;
024    
025    import java.io.Externalizable;
026    import java.io.IOException;
027    import java.io.ObjectInput;
028    import java.io.ObjectOutput;
029    
030    import java.util.Date;
031    
032    /**
033     * The cache model class for representing MBMailingList in entity cache.
034     *
035     * @author Brian Wing Shun Chan
036     * @see MBMailingList
037     * @generated
038     */
039    @ProviderType
040    public class MBMailingListCacheModel implements CacheModel<MBMailingList>,
041            Externalizable {
042            @Override
043            public String toString() {
044                    StringBundler sb = new StringBundler(53);
045    
046                    sb.append("{uuid=");
047                    sb.append(uuid);
048                    sb.append(", mailingListId=");
049                    sb.append(mailingListId);
050                    sb.append(", groupId=");
051                    sb.append(groupId);
052                    sb.append(", companyId=");
053                    sb.append(companyId);
054                    sb.append(", userId=");
055                    sb.append(userId);
056                    sb.append(", userName=");
057                    sb.append(userName);
058                    sb.append(", createDate=");
059                    sb.append(createDate);
060                    sb.append(", modifiedDate=");
061                    sb.append(modifiedDate);
062                    sb.append(", categoryId=");
063                    sb.append(categoryId);
064                    sb.append(", emailAddress=");
065                    sb.append(emailAddress);
066                    sb.append(", inProtocol=");
067                    sb.append(inProtocol);
068                    sb.append(", inServerName=");
069                    sb.append(inServerName);
070                    sb.append(", inServerPort=");
071                    sb.append(inServerPort);
072                    sb.append(", inUseSSL=");
073                    sb.append(inUseSSL);
074                    sb.append(", inUserName=");
075                    sb.append(inUserName);
076                    sb.append(", inPassword=");
077                    sb.append(inPassword);
078                    sb.append(", inReadInterval=");
079                    sb.append(inReadInterval);
080                    sb.append(", outEmailAddress=");
081                    sb.append(outEmailAddress);
082                    sb.append(", outCustom=");
083                    sb.append(outCustom);
084                    sb.append(", outServerName=");
085                    sb.append(outServerName);
086                    sb.append(", outServerPort=");
087                    sb.append(outServerPort);
088                    sb.append(", outUseSSL=");
089                    sb.append(outUseSSL);
090                    sb.append(", outUserName=");
091                    sb.append(outUserName);
092                    sb.append(", outPassword=");
093                    sb.append(outPassword);
094                    sb.append(", allowAnonymous=");
095                    sb.append(allowAnonymous);
096                    sb.append(", active=");
097                    sb.append(active);
098                    sb.append("}");
099    
100                    return sb.toString();
101            }
102    
103            @Override
104            public MBMailingList toEntityModel() {
105                    MBMailingListImpl mbMailingListImpl = new MBMailingListImpl();
106    
107                    if (uuid == null) {
108                            mbMailingListImpl.setUuid(StringPool.BLANK);
109                    }
110                    else {
111                            mbMailingListImpl.setUuid(uuid);
112                    }
113    
114                    mbMailingListImpl.setMailingListId(mailingListId);
115                    mbMailingListImpl.setGroupId(groupId);
116                    mbMailingListImpl.setCompanyId(companyId);
117                    mbMailingListImpl.setUserId(userId);
118    
119                    if (userName == null) {
120                            mbMailingListImpl.setUserName(StringPool.BLANK);
121                    }
122                    else {
123                            mbMailingListImpl.setUserName(userName);
124                    }
125    
126                    if (createDate == Long.MIN_VALUE) {
127                            mbMailingListImpl.setCreateDate(null);
128                    }
129                    else {
130                            mbMailingListImpl.setCreateDate(new Date(createDate));
131                    }
132    
133                    if (modifiedDate == Long.MIN_VALUE) {
134                            mbMailingListImpl.setModifiedDate(null);
135                    }
136                    else {
137                            mbMailingListImpl.setModifiedDate(new Date(modifiedDate));
138                    }
139    
140                    mbMailingListImpl.setCategoryId(categoryId);
141    
142                    if (emailAddress == null) {
143                            mbMailingListImpl.setEmailAddress(StringPool.BLANK);
144                    }
145                    else {
146                            mbMailingListImpl.setEmailAddress(emailAddress);
147                    }
148    
149                    if (inProtocol == null) {
150                            mbMailingListImpl.setInProtocol(StringPool.BLANK);
151                    }
152                    else {
153                            mbMailingListImpl.setInProtocol(inProtocol);
154                    }
155    
156                    if (inServerName == null) {
157                            mbMailingListImpl.setInServerName(StringPool.BLANK);
158                    }
159                    else {
160                            mbMailingListImpl.setInServerName(inServerName);
161                    }
162    
163                    mbMailingListImpl.setInServerPort(inServerPort);
164                    mbMailingListImpl.setInUseSSL(inUseSSL);
165    
166                    if (inUserName == null) {
167                            mbMailingListImpl.setInUserName(StringPool.BLANK);
168                    }
169                    else {
170                            mbMailingListImpl.setInUserName(inUserName);
171                    }
172    
173                    if (inPassword == null) {
174                            mbMailingListImpl.setInPassword(StringPool.BLANK);
175                    }
176                    else {
177                            mbMailingListImpl.setInPassword(inPassword);
178                    }
179    
180                    mbMailingListImpl.setInReadInterval(inReadInterval);
181    
182                    if (outEmailAddress == null) {
183                            mbMailingListImpl.setOutEmailAddress(StringPool.BLANK);
184                    }
185                    else {
186                            mbMailingListImpl.setOutEmailAddress(outEmailAddress);
187                    }
188    
189                    mbMailingListImpl.setOutCustom(outCustom);
190    
191                    if (outServerName == null) {
192                            mbMailingListImpl.setOutServerName(StringPool.BLANK);
193                    }
194                    else {
195                            mbMailingListImpl.setOutServerName(outServerName);
196                    }
197    
198                    mbMailingListImpl.setOutServerPort(outServerPort);
199                    mbMailingListImpl.setOutUseSSL(outUseSSL);
200    
201                    if (outUserName == null) {
202                            mbMailingListImpl.setOutUserName(StringPool.BLANK);
203                    }
204                    else {
205                            mbMailingListImpl.setOutUserName(outUserName);
206                    }
207    
208                    if (outPassword == null) {
209                            mbMailingListImpl.setOutPassword(StringPool.BLANK);
210                    }
211                    else {
212                            mbMailingListImpl.setOutPassword(outPassword);
213                    }
214    
215                    mbMailingListImpl.setAllowAnonymous(allowAnonymous);
216                    mbMailingListImpl.setActive(active);
217    
218                    mbMailingListImpl.resetOriginalValues();
219    
220                    return mbMailingListImpl;
221            }
222    
223            @Override
224            public void readExternal(ObjectInput objectInput) throws IOException {
225                    uuid = objectInput.readUTF();
226                    mailingListId = objectInput.readLong();
227                    groupId = objectInput.readLong();
228                    companyId = objectInput.readLong();
229                    userId = objectInput.readLong();
230                    userName = objectInput.readUTF();
231                    createDate = objectInput.readLong();
232                    modifiedDate = objectInput.readLong();
233                    categoryId = objectInput.readLong();
234                    emailAddress = objectInput.readUTF();
235                    inProtocol = objectInput.readUTF();
236                    inServerName = objectInput.readUTF();
237                    inServerPort = objectInput.readInt();
238                    inUseSSL = objectInput.readBoolean();
239                    inUserName = objectInput.readUTF();
240                    inPassword = objectInput.readUTF();
241                    inReadInterval = objectInput.readInt();
242                    outEmailAddress = objectInput.readUTF();
243                    outCustom = objectInput.readBoolean();
244                    outServerName = objectInput.readUTF();
245                    outServerPort = objectInput.readInt();
246                    outUseSSL = objectInput.readBoolean();
247                    outUserName = objectInput.readUTF();
248                    outPassword = objectInput.readUTF();
249                    allowAnonymous = objectInput.readBoolean();
250                    active = objectInput.readBoolean();
251            }
252    
253            @Override
254            public void writeExternal(ObjectOutput objectOutput)
255                    throws IOException {
256                    if (uuid == null) {
257                            objectOutput.writeUTF(StringPool.BLANK);
258                    }
259                    else {
260                            objectOutput.writeUTF(uuid);
261                    }
262    
263                    objectOutput.writeLong(mailingListId);
264                    objectOutput.writeLong(groupId);
265                    objectOutput.writeLong(companyId);
266                    objectOutput.writeLong(userId);
267    
268                    if (userName == null) {
269                            objectOutput.writeUTF(StringPool.BLANK);
270                    }
271                    else {
272                            objectOutput.writeUTF(userName);
273                    }
274    
275                    objectOutput.writeLong(createDate);
276                    objectOutput.writeLong(modifiedDate);
277                    objectOutput.writeLong(categoryId);
278    
279                    if (emailAddress == null) {
280                            objectOutput.writeUTF(StringPool.BLANK);
281                    }
282                    else {
283                            objectOutput.writeUTF(emailAddress);
284                    }
285    
286                    if (inProtocol == null) {
287                            objectOutput.writeUTF(StringPool.BLANK);
288                    }
289                    else {
290                            objectOutput.writeUTF(inProtocol);
291                    }
292    
293                    if (inServerName == null) {
294                            objectOutput.writeUTF(StringPool.BLANK);
295                    }
296                    else {
297                            objectOutput.writeUTF(inServerName);
298                    }
299    
300                    objectOutput.writeInt(inServerPort);
301                    objectOutput.writeBoolean(inUseSSL);
302    
303                    if (inUserName == null) {
304                            objectOutput.writeUTF(StringPool.BLANK);
305                    }
306                    else {
307                            objectOutput.writeUTF(inUserName);
308                    }
309    
310                    if (inPassword == null) {
311                            objectOutput.writeUTF(StringPool.BLANK);
312                    }
313                    else {
314                            objectOutput.writeUTF(inPassword);
315                    }
316    
317                    objectOutput.writeInt(inReadInterval);
318    
319                    if (outEmailAddress == null) {
320                            objectOutput.writeUTF(StringPool.BLANK);
321                    }
322                    else {
323                            objectOutput.writeUTF(outEmailAddress);
324                    }
325    
326                    objectOutput.writeBoolean(outCustom);
327    
328                    if (outServerName == null) {
329                            objectOutput.writeUTF(StringPool.BLANK);
330                    }
331                    else {
332                            objectOutput.writeUTF(outServerName);
333                    }
334    
335                    objectOutput.writeInt(outServerPort);
336                    objectOutput.writeBoolean(outUseSSL);
337    
338                    if (outUserName == null) {
339                            objectOutput.writeUTF(StringPool.BLANK);
340                    }
341                    else {
342                            objectOutput.writeUTF(outUserName);
343                    }
344    
345                    if (outPassword == null) {
346                            objectOutput.writeUTF(StringPool.BLANK);
347                    }
348                    else {
349                            objectOutput.writeUTF(outPassword);
350                    }
351    
352                    objectOutput.writeBoolean(allowAnonymous);
353                    objectOutput.writeBoolean(active);
354            }
355    
356            public String uuid;
357            public long mailingListId;
358            public long groupId;
359            public long companyId;
360            public long userId;
361            public String userName;
362            public long createDate;
363            public long modifiedDate;
364            public long categoryId;
365            public String emailAddress;
366            public String inProtocol;
367            public String inServerName;
368            public int inServerPort;
369            public boolean inUseSSL;
370            public String inUserName;
371            public String inPassword;
372            public int inReadInterval;
373            public String outEmailAddress;
374            public boolean outCustom;
375            public String outServerName;
376            public int outServerPort;
377            public boolean outUseSSL;
378            public String outUserName;
379            public String outPassword;
380            public boolean allowAnonymous;
381            public boolean active;
382    }