001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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.UserGroup;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing UserGroup in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see UserGroup
029     * @generated
030     */
031    public class UserGroupCacheModel implements CacheModel<UserGroup>, Serializable {
032            @Override
033            public String toString() {
034                    StringBundler sb = new StringBundler(17);
035    
036                    sb.append("{userGroupId=");
037                    sb.append(userGroupId);
038                    sb.append(", companyId=");
039                    sb.append(companyId);
040                    sb.append(", parentUserGroupId=");
041                    sb.append(parentUserGroupId);
042                    sb.append(", name=");
043                    sb.append(name);
044                    sb.append(", description=");
045                    sb.append(description);
046                    sb.append(", publicLayoutSetPrototypeId=");
047                    sb.append(publicLayoutSetPrototypeId);
048                    sb.append(", privateLayoutSetPrototypeId=");
049                    sb.append(privateLayoutSetPrototypeId);
050                    sb.append(", addedByLDAPImport=");
051                    sb.append(addedByLDAPImport);
052                    sb.append("}");
053    
054                    return sb.toString();
055            }
056    
057            public UserGroup toEntityModel() {
058                    UserGroupImpl userGroupImpl = new UserGroupImpl();
059    
060                    userGroupImpl.setUserGroupId(userGroupId);
061                    userGroupImpl.setCompanyId(companyId);
062                    userGroupImpl.setParentUserGroupId(parentUserGroupId);
063    
064                    if (name == null) {
065                            userGroupImpl.setName(StringPool.BLANK);
066                    }
067                    else {
068                            userGroupImpl.setName(name);
069                    }
070    
071                    if (description == null) {
072                            userGroupImpl.setDescription(StringPool.BLANK);
073                    }
074                    else {
075                            userGroupImpl.setDescription(description);
076                    }
077    
078                    userGroupImpl.setPublicLayoutSetPrototypeId(publicLayoutSetPrototypeId);
079                    userGroupImpl.setPrivateLayoutSetPrototypeId(privateLayoutSetPrototypeId);
080                    userGroupImpl.setAddedByLDAPImport(addedByLDAPImport);
081    
082                    userGroupImpl.resetOriginalValues();
083    
084                    return userGroupImpl;
085            }
086    
087            public long userGroupId;
088            public long companyId;
089            public long parentUserGroupId;
090            public String name;
091            public String description;
092            public long publicLayoutSetPrototypeId;
093            public long privateLayoutSetPrototypeId;
094            public boolean addedByLDAPImport;
095    }