001    /**
002     * Copyright (c) 2000-2011 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.LayoutSetBranch;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing LayoutSetBranch in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see LayoutSetBranch
031     * @generated
032     */
033    public class LayoutSetBranchCacheModel implements CacheModel<LayoutSetBranch>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(23);
038    
039                    sb.append("{layoutSetBranchId=");
040                    sb.append(layoutSetBranchId);
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(", privateLayout=");
054                    sb.append(privateLayout);
055                    sb.append(", name=");
056                    sb.append(name);
057                    sb.append(", description=");
058                    sb.append(description);
059                    sb.append(", master=");
060                    sb.append(master);
061                    sb.append("}");
062    
063                    return sb.toString();
064            }
065    
066            public LayoutSetBranch toEntityModel() {
067                    LayoutSetBranchImpl layoutSetBranchImpl = new LayoutSetBranchImpl();
068    
069                    layoutSetBranchImpl.setLayoutSetBranchId(layoutSetBranchId);
070                    layoutSetBranchImpl.setGroupId(groupId);
071                    layoutSetBranchImpl.setCompanyId(companyId);
072                    layoutSetBranchImpl.setUserId(userId);
073    
074                    if (userName == null) {
075                            layoutSetBranchImpl.setUserName(StringPool.BLANK);
076                    }
077                    else {
078                            layoutSetBranchImpl.setUserName(userName);
079                    }
080    
081                    if (createDate == Long.MIN_VALUE) {
082                            layoutSetBranchImpl.setCreateDate(null);
083                    }
084                    else {
085                            layoutSetBranchImpl.setCreateDate(new Date(createDate));
086                    }
087    
088                    if (modifiedDate == Long.MIN_VALUE) {
089                            layoutSetBranchImpl.setModifiedDate(null);
090                    }
091                    else {
092                            layoutSetBranchImpl.setModifiedDate(new Date(modifiedDate));
093                    }
094    
095                    layoutSetBranchImpl.setPrivateLayout(privateLayout);
096    
097                    if (name == null) {
098                            layoutSetBranchImpl.setName(StringPool.BLANK);
099                    }
100                    else {
101                            layoutSetBranchImpl.setName(name);
102                    }
103    
104                    if (description == null) {
105                            layoutSetBranchImpl.setDescription(StringPool.BLANK);
106                    }
107                    else {
108                            layoutSetBranchImpl.setDescription(description);
109                    }
110    
111                    layoutSetBranchImpl.setMaster(master);
112    
113                    layoutSetBranchImpl.resetOriginalValues();
114    
115                    return layoutSetBranchImpl;
116            }
117    
118            public long layoutSetBranchId;
119            public long groupId;
120            public long companyId;
121            public long userId;
122            public String userName;
123            public long createDate;
124            public long modifiedDate;
125            public boolean privateLayout;
126            public String name;
127            public String description;
128            public boolean master;
129    }