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.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(13);
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(", addedByLDAPImport=");
047                    sb.append(addedByLDAPImport);
048                    sb.append("}");
049    
050                    return sb.toString();
051            }
052    
053            public UserGroup toEntityModel() {
054                    UserGroupImpl userGroupImpl = new UserGroupImpl();
055    
056                    userGroupImpl.setUserGroupId(userGroupId);
057                    userGroupImpl.setCompanyId(companyId);
058                    userGroupImpl.setParentUserGroupId(parentUserGroupId);
059    
060                    if (name == null) {
061                            userGroupImpl.setName(StringPool.BLANK);
062                    }
063                    else {
064                            userGroupImpl.setName(name);
065                    }
066    
067                    if (description == null) {
068                            userGroupImpl.setDescription(StringPool.BLANK);
069                    }
070                    else {
071                            userGroupImpl.setDescription(description);
072                    }
073    
074                    userGroupImpl.setAddedByLDAPImport(addedByLDAPImport);
075    
076                    userGroupImpl.resetOriginalValues();
077    
078                    return userGroupImpl;
079            }
080    
081            public long userGroupId;
082            public long companyId;
083            public long parentUserGroupId;
084            public String name;
085            public String description;
086            public boolean addedByLDAPImport;
087    }