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.Group;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing Group in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see Group
029     * @generated
030     */
031    public class GroupCacheModel implements CacheModel<Group>, Serializable {
032            @Override
033            public String toString() {
034                    StringBundler sb = new StringBundler(29);
035    
036                    sb.append("{groupId=");
037                    sb.append(groupId);
038                    sb.append(", companyId=");
039                    sb.append(companyId);
040                    sb.append(", creatorUserId=");
041                    sb.append(creatorUserId);
042                    sb.append(", classNameId=");
043                    sb.append(classNameId);
044                    sb.append(", classPK=");
045                    sb.append(classPK);
046                    sb.append(", parentGroupId=");
047                    sb.append(parentGroupId);
048                    sb.append(", liveGroupId=");
049                    sb.append(liveGroupId);
050                    sb.append(", name=");
051                    sb.append(name);
052                    sb.append(", description=");
053                    sb.append(description);
054                    sb.append(", type=");
055                    sb.append(type);
056                    sb.append(", typeSettings=");
057                    sb.append(typeSettings);
058                    sb.append(", friendlyURL=");
059                    sb.append(friendlyURL);
060                    sb.append(", site=");
061                    sb.append(site);
062                    sb.append(", active=");
063                    sb.append(active);
064                    sb.append("}");
065    
066                    return sb.toString();
067            }
068    
069            public Group toEntityModel() {
070                    GroupImpl groupImpl = new GroupImpl();
071    
072                    groupImpl.setGroupId(groupId);
073                    groupImpl.setCompanyId(companyId);
074                    groupImpl.setCreatorUserId(creatorUserId);
075                    groupImpl.setClassNameId(classNameId);
076                    groupImpl.setClassPK(classPK);
077                    groupImpl.setParentGroupId(parentGroupId);
078                    groupImpl.setLiveGroupId(liveGroupId);
079    
080                    if (name == null) {
081                            groupImpl.setName(StringPool.BLANK);
082                    }
083                    else {
084                            groupImpl.setName(name);
085                    }
086    
087                    if (description == null) {
088                            groupImpl.setDescription(StringPool.BLANK);
089                    }
090                    else {
091                            groupImpl.setDescription(description);
092                    }
093    
094                    groupImpl.setType(type);
095    
096                    if (typeSettings == null) {
097                            groupImpl.setTypeSettings(StringPool.BLANK);
098                    }
099                    else {
100                            groupImpl.setTypeSettings(typeSettings);
101                    }
102    
103                    if (friendlyURL == null) {
104                            groupImpl.setFriendlyURL(StringPool.BLANK);
105                    }
106                    else {
107                            groupImpl.setFriendlyURL(friendlyURL);
108                    }
109    
110                    groupImpl.setSite(site);
111                    groupImpl.setActive(active);
112    
113                    groupImpl.resetOriginalValues();
114    
115                    return groupImpl;
116            }
117    
118            public long groupId;
119            public long companyId;
120            public long creatorUserId;
121            public long classNameId;
122            public long classPK;
123            public long parentGroupId;
124            public long liveGroupId;
125            public String name;
126            public String description;
127            public int type;
128            public String typeSettings;
129            public String friendlyURL;
130            public boolean site;
131            public boolean active;
132    }