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.LayoutBranch;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing LayoutBranch in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see LayoutBranch
029     * @generated
030     */
031    public class LayoutBranchCacheModel implements CacheModel<LayoutBranch>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(21);
036    
037                    sb.append("{LayoutBranchId=");
038                    sb.append(LayoutBranchId);
039                    sb.append(", groupId=");
040                    sb.append(groupId);
041                    sb.append(", companyId=");
042                    sb.append(companyId);
043                    sb.append(", userId=");
044                    sb.append(userId);
045                    sb.append(", userName=");
046                    sb.append(userName);
047                    sb.append(", layoutSetBranchId=");
048                    sb.append(layoutSetBranchId);
049                    sb.append(", plid=");
050                    sb.append(plid);
051                    sb.append(", name=");
052                    sb.append(name);
053                    sb.append(", description=");
054                    sb.append(description);
055                    sb.append(", master=");
056                    sb.append(master);
057                    sb.append("}");
058    
059                    return sb.toString();
060            }
061    
062            public LayoutBranch toEntityModel() {
063                    LayoutBranchImpl layoutBranchImpl = new LayoutBranchImpl();
064    
065                    layoutBranchImpl.setLayoutBranchId(LayoutBranchId);
066                    layoutBranchImpl.setGroupId(groupId);
067                    layoutBranchImpl.setCompanyId(companyId);
068                    layoutBranchImpl.setUserId(userId);
069    
070                    if (userName == null) {
071                            layoutBranchImpl.setUserName(StringPool.BLANK);
072                    }
073                    else {
074                            layoutBranchImpl.setUserName(userName);
075                    }
076    
077                    layoutBranchImpl.setLayoutSetBranchId(layoutSetBranchId);
078                    layoutBranchImpl.setPlid(plid);
079    
080                    if (name == null) {
081                            layoutBranchImpl.setName(StringPool.BLANK);
082                    }
083                    else {
084                            layoutBranchImpl.setName(name);
085                    }
086    
087                    if (description == null) {
088                            layoutBranchImpl.setDescription(StringPool.BLANK);
089                    }
090                    else {
091                            layoutBranchImpl.setDescription(description);
092                    }
093    
094                    layoutBranchImpl.setMaster(master);
095    
096                    layoutBranchImpl.resetOriginalValues();
097    
098                    return layoutBranchImpl;
099            }
100    
101            public long LayoutBranchId;
102            public long groupId;
103            public long companyId;
104            public long userId;
105            public String userName;
106            public long layoutSetBranchId;
107            public long plid;
108            public String name;
109            public String description;
110            public boolean master;
111    }