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.MBBan;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing MBBan in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see MBBan
032     * @generated
033     */
034    public class MBBanCacheModel implements CacheModel<MBBan>, Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(17);
038    
039                    sb.append("{banId=");
040                    sb.append(banId);
041                    sb.append(", groupId=");
042                    sb.append(groupId);
043                    sb.append(", companyId=");
044                    sb.append(companyId);
045                    sb.append(", userId=");
046                    sb.append(userId);
047                    sb.append(", userName=");
048                    sb.append(userName);
049                    sb.append(", createDate=");
050                    sb.append(createDate);
051                    sb.append(", modifiedDate=");
052                    sb.append(modifiedDate);
053                    sb.append(", banUserId=");
054                    sb.append(banUserId);
055                    sb.append("}");
056    
057                    return sb.toString();
058            }
059    
060            public MBBan toEntityModel() {
061                    MBBanImpl mbBanImpl = new MBBanImpl();
062    
063                    mbBanImpl.setBanId(banId);
064                    mbBanImpl.setGroupId(groupId);
065                    mbBanImpl.setCompanyId(companyId);
066                    mbBanImpl.setUserId(userId);
067    
068                    if (userName == null) {
069                            mbBanImpl.setUserName(StringPool.BLANK);
070                    }
071                    else {
072                            mbBanImpl.setUserName(userName);
073                    }
074    
075                    if (createDate == Long.MIN_VALUE) {
076                            mbBanImpl.setCreateDate(null);
077                    }
078                    else {
079                            mbBanImpl.setCreateDate(new Date(createDate));
080                    }
081    
082                    if (modifiedDate == Long.MIN_VALUE) {
083                            mbBanImpl.setModifiedDate(null);
084                    }
085                    else {
086                            mbBanImpl.setModifiedDate(new Date(modifiedDate));
087                    }
088    
089                    mbBanImpl.setBanUserId(banUserId);
090    
091                    mbBanImpl.resetOriginalValues();
092    
093                    return mbBanImpl;
094            }
095    
096            public long banId;
097            public long groupId;
098            public long companyId;
099            public long userId;
100            public String userName;
101            public long createDate;
102            public long modifiedDate;
103            public long banUserId;
104    }