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.model.CacheModel;
019    import com.liferay.portal.model.ResourceBlockPermission;
020    
021    import java.io.Externalizable;
022    import java.io.IOException;
023    import java.io.ObjectInput;
024    import java.io.ObjectOutput;
025    
026    /**
027     * The cache model class for representing ResourceBlockPermission in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see ResourceBlockPermission
031     * @generated
032     */
033    public class ResourceBlockPermissionCacheModel implements CacheModel<ResourceBlockPermission>,
034            Externalizable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(9);
038    
039                    sb.append("{resourceBlockPermissionId=");
040                    sb.append(resourceBlockPermissionId);
041                    sb.append(", resourceBlockId=");
042                    sb.append(resourceBlockId);
043                    sb.append(", roleId=");
044                    sb.append(roleId);
045                    sb.append(", actionIds=");
046                    sb.append(actionIds);
047                    sb.append("}");
048    
049                    return sb.toString();
050            }
051    
052            @Override
053            public ResourceBlockPermission toEntityModel() {
054                    ResourceBlockPermissionImpl resourceBlockPermissionImpl = new ResourceBlockPermissionImpl();
055    
056                    resourceBlockPermissionImpl.setResourceBlockPermissionId(resourceBlockPermissionId);
057                    resourceBlockPermissionImpl.setResourceBlockId(resourceBlockId);
058                    resourceBlockPermissionImpl.setRoleId(roleId);
059                    resourceBlockPermissionImpl.setActionIds(actionIds);
060    
061                    resourceBlockPermissionImpl.resetOriginalValues();
062    
063                    return resourceBlockPermissionImpl;
064            }
065    
066            @Override
067            public void readExternal(ObjectInput objectInput) throws IOException {
068                    resourceBlockPermissionId = objectInput.readLong();
069                    resourceBlockId = objectInput.readLong();
070                    roleId = objectInput.readLong();
071                    actionIds = objectInput.readLong();
072            }
073    
074            @Override
075            public void writeExternal(ObjectOutput objectOutput)
076                    throws IOException {
077                    objectOutput.writeLong(resourceBlockPermissionId);
078                    objectOutput.writeLong(resourceBlockId);
079                    objectOutput.writeLong(roleId);
080                    objectOutput.writeLong(actionIds);
081            }
082    
083            public long resourceBlockPermissionId;
084            public long resourceBlockId;
085            public long roleId;
086            public long actionIds;
087    }