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.ResourcePermission;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing ResourcePermission in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see ResourcePermission
029     * @generated
030     */
031    public class ResourcePermissionCacheModel implements CacheModel<ResourcePermission>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(17);
036    
037                    sb.append("{resourcePermissionId=");
038                    sb.append(resourcePermissionId);
039                    sb.append(", companyId=");
040                    sb.append(companyId);
041                    sb.append(", name=");
042                    sb.append(name);
043                    sb.append(", scope=");
044                    sb.append(scope);
045                    sb.append(", primKey=");
046                    sb.append(primKey);
047                    sb.append(", roleId=");
048                    sb.append(roleId);
049                    sb.append(", ownerId=");
050                    sb.append(ownerId);
051                    sb.append(", actionIds=");
052                    sb.append(actionIds);
053                    sb.append("}");
054    
055                    return sb.toString();
056            }
057    
058            public ResourcePermission toEntityModel() {
059                    ResourcePermissionImpl resourcePermissionImpl = new ResourcePermissionImpl();
060    
061                    resourcePermissionImpl.setResourcePermissionId(resourcePermissionId);
062                    resourcePermissionImpl.setCompanyId(companyId);
063    
064                    if (name == null) {
065                            resourcePermissionImpl.setName(StringPool.BLANK);
066                    }
067                    else {
068                            resourcePermissionImpl.setName(name);
069                    }
070    
071                    resourcePermissionImpl.setScope(scope);
072    
073                    if (primKey == null) {
074                            resourcePermissionImpl.setPrimKey(StringPool.BLANK);
075                    }
076                    else {
077                            resourcePermissionImpl.setPrimKey(primKey);
078                    }
079    
080                    resourcePermissionImpl.setRoleId(roleId);
081                    resourcePermissionImpl.setOwnerId(ownerId);
082                    resourcePermissionImpl.setActionIds(actionIds);
083    
084                    resourcePermissionImpl.resetOriginalValues();
085    
086                    return resourcePermissionImpl;
087            }
088    
089            public long resourcePermissionId;
090            public long companyId;
091            public String name;
092            public int scope;
093            public String primKey;
094            public long roleId;
095            public long ownerId;
096            public long actionIds;
097    }