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.WorkflowInstanceLink;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing WorkflowInstanceLink in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see WorkflowInstanceLink
031     * @generated
032     */
033    public class WorkflowInstanceLinkCacheModel implements CacheModel<WorkflowInstanceLink>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(21);
038    
039                    sb.append("{workflowInstanceLinkId=");
040                    sb.append(workflowInstanceLinkId);
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(", classNameId=");
054                    sb.append(classNameId);
055                    sb.append(", classPK=");
056                    sb.append(classPK);
057                    sb.append(", workflowInstanceId=");
058                    sb.append(workflowInstanceId);
059                    sb.append("}");
060    
061                    return sb.toString();
062            }
063    
064            public WorkflowInstanceLink toEntityModel() {
065                    WorkflowInstanceLinkImpl workflowInstanceLinkImpl = new WorkflowInstanceLinkImpl();
066    
067                    workflowInstanceLinkImpl.setWorkflowInstanceLinkId(workflowInstanceLinkId);
068                    workflowInstanceLinkImpl.setGroupId(groupId);
069                    workflowInstanceLinkImpl.setCompanyId(companyId);
070                    workflowInstanceLinkImpl.setUserId(userId);
071    
072                    if (userName == null) {
073                            workflowInstanceLinkImpl.setUserName(StringPool.BLANK);
074                    }
075                    else {
076                            workflowInstanceLinkImpl.setUserName(userName);
077                    }
078    
079                    if (createDate == Long.MIN_VALUE) {
080                            workflowInstanceLinkImpl.setCreateDate(null);
081                    }
082                    else {
083                            workflowInstanceLinkImpl.setCreateDate(new Date(createDate));
084                    }
085    
086                    if (modifiedDate == Long.MIN_VALUE) {
087                            workflowInstanceLinkImpl.setModifiedDate(null);
088                    }
089                    else {
090                            workflowInstanceLinkImpl.setModifiedDate(new Date(modifiedDate));
091                    }
092    
093                    workflowInstanceLinkImpl.setClassNameId(classNameId);
094                    workflowInstanceLinkImpl.setClassPK(classPK);
095                    workflowInstanceLinkImpl.setWorkflowInstanceId(workflowInstanceId);
096    
097                    workflowInstanceLinkImpl.resetOriginalValues();
098    
099                    return workflowInstanceLinkImpl;
100            }
101    
102            public long workflowInstanceLinkId;
103            public long groupId;
104            public long companyId;
105            public long userId;
106            public String userName;
107            public long createDate;
108            public long modifiedDate;
109            public long classNameId;
110            public long classPK;
111            public long workflowInstanceId;
112    }