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.portal.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    import com.liferay.portal.model.MembershipRequest;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing MembershipRequest in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see MembershipRequest
031     * @generated
032     */
033    public class MembershipRequestCacheModel implements CacheModel<MembershipRequest>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(21);
038    
039                    sb.append("{membershipRequestId=");
040                    sb.append(membershipRequestId);
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(", createDate=");
048                    sb.append(createDate);
049                    sb.append(", comments=");
050                    sb.append(comments);
051                    sb.append(", replyComments=");
052                    sb.append(replyComments);
053                    sb.append(", replyDate=");
054                    sb.append(replyDate);
055                    sb.append(", replierUserId=");
056                    sb.append(replierUserId);
057                    sb.append(", statusId=");
058                    sb.append(statusId);
059                    sb.append("}");
060    
061                    return sb.toString();
062            }
063    
064            public MembershipRequest toEntityModel() {
065                    MembershipRequestImpl membershipRequestImpl = new MembershipRequestImpl();
066    
067                    membershipRequestImpl.setMembershipRequestId(membershipRequestId);
068                    membershipRequestImpl.setGroupId(groupId);
069                    membershipRequestImpl.setCompanyId(companyId);
070                    membershipRequestImpl.setUserId(userId);
071    
072                    if (createDate == Long.MIN_VALUE) {
073                            membershipRequestImpl.setCreateDate(null);
074                    }
075                    else {
076                            membershipRequestImpl.setCreateDate(new Date(createDate));
077                    }
078    
079                    if (comments == null) {
080                            membershipRequestImpl.setComments(StringPool.BLANK);
081                    }
082                    else {
083                            membershipRequestImpl.setComments(comments);
084                    }
085    
086                    if (replyComments == null) {
087                            membershipRequestImpl.setReplyComments(StringPool.BLANK);
088                    }
089                    else {
090                            membershipRequestImpl.setReplyComments(replyComments);
091                    }
092    
093                    if (replyDate == Long.MIN_VALUE) {
094                            membershipRequestImpl.setReplyDate(null);
095                    }
096                    else {
097                            membershipRequestImpl.setReplyDate(new Date(replyDate));
098                    }
099    
100                    membershipRequestImpl.setReplierUserId(replierUserId);
101                    membershipRequestImpl.setStatusId(statusId);
102    
103                    membershipRequestImpl.resetOriginalValues();
104    
105                    return membershipRequestImpl;
106            }
107    
108            public long membershipRequestId;
109            public long groupId;
110            public long companyId;
111            public long userId;
112            public long createDate;
113            public String comments;
114            public String replyComments;
115            public long replyDate;
116            public long replierUserId;
117            public int statusId;
118    }