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.WorkflowDefinitionLink;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing WorkflowDefinitionLink in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see WorkflowDefinitionLink
031     * @generated
032     */
033    public class WorkflowDefinitionLinkCacheModel implements CacheModel<WorkflowDefinitionLink>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(25);
038    
039                    sb.append("{workflowDefinitionLinkId=");
040                    sb.append(workflowDefinitionLinkId);
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(", typePK=");
058                    sb.append(typePK);
059                    sb.append(", workflowDefinitionName=");
060                    sb.append(workflowDefinitionName);
061                    sb.append(", workflowDefinitionVersion=");
062                    sb.append(workflowDefinitionVersion);
063                    sb.append("}");
064    
065                    return sb.toString();
066            }
067    
068            public WorkflowDefinitionLink toEntityModel() {
069                    WorkflowDefinitionLinkImpl workflowDefinitionLinkImpl = new WorkflowDefinitionLinkImpl();
070    
071                    workflowDefinitionLinkImpl.setWorkflowDefinitionLinkId(workflowDefinitionLinkId);
072                    workflowDefinitionLinkImpl.setGroupId(groupId);
073                    workflowDefinitionLinkImpl.setCompanyId(companyId);
074                    workflowDefinitionLinkImpl.setUserId(userId);
075    
076                    if (userName == null) {
077                            workflowDefinitionLinkImpl.setUserName(StringPool.BLANK);
078                    }
079                    else {
080                            workflowDefinitionLinkImpl.setUserName(userName);
081                    }
082    
083                    if (createDate == Long.MIN_VALUE) {
084                            workflowDefinitionLinkImpl.setCreateDate(null);
085                    }
086                    else {
087                            workflowDefinitionLinkImpl.setCreateDate(new Date(createDate));
088                    }
089    
090                    if (modifiedDate == Long.MIN_VALUE) {
091                            workflowDefinitionLinkImpl.setModifiedDate(null);
092                    }
093                    else {
094                            workflowDefinitionLinkImpl.setModifiedDate(new Date(modifiedDate));
095                    }
096    
097                    workflowDefinitionLinkImpl.setClassNameId(classNameId);
098                    workflowDefinitionLinkImpl.setClassPK(classPK);
099                    workflowDefinitionLinkImpl.setTypePK(typePK);
100    
101                    if (workflowDefinitionName == null) {
102                            workflowDefinitionLinkImpl.setWorkflowDefinitionName(StringPool.BLANK);
103                    }
104                    else {
105                            workflowDefinitionLinkImpl.setWorkflowDefinitionName(workflowDefinitionName);
106                    }
107    
108                    workflowDefinitionLinkImpl.setWorkflowDefinitionVersion(workflowDefinitionVersion);
109    
110                    workflowDefinitionLinkImpl.resetOriginalValues();
111    
112                    return workflowDefinitionLinkImpl;
113            }
114    
115            public long workflowDefinitionLinkId;
116            public long groupId;
117            public long companyId;
118            public long userId;
119            public String userName;
120            public long createDate;
121            public long modifiedDate;
122            public long classNameId;
123            public long classPK;
124            public long typePK;
125            public String workflowDefinitionName;
126            public int workflowDefinitionVersion;
127    }