001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.model.CacheModel;
021    import com.liferay.portal.model.MVCCModel;
022    import com.liferay.portal.model.ResourceBlockPermission;
023    
024    import java.io.Externalizable;
025    import java.io.IOException;
026    import java.io.ObjectInput;
027    import java.io.ObjectOutput;
028    
029    /**
030     * The cache model class for representing ResourceBlockPermission in entity cache.
031     *
032     * @author Brian Wing Shun Chan
033     * @see ResourceBlockPermission
034     * @generated
035     */
036    @ProviderType
037    public class ResourceBlockPermissionCacheModel implements CacheModel<ResourceBlockPermission>,
038            Externalizable, MVCCModel {
039            @Override
040            public long getMvccVersion() {
041                    return mvccVersion;
042            }
043    
044            @Override
045            public void setMvccVersion(long mvccVersion) {
046                    this.mvccVersion = mvccVersion;
047            }
048    
049            @Override
050            public String toString() {
051                    StringBundler sb = new StringBundler(11);
052    
053                    sb.append("{mvccVersion=");
054                    sb.append(mvccVersion);
055                    sb.append(", resourceBlockPermissionId=");
056                    sb.append(resourceBlockPermissionId);
057                    sb.append(", resourceBlockId=");
058                    sb.append(resourceBlockId);
059                    sb.append(", roleId=");
060                    sb.append(roleId);
061                    sb.append(", actionIds=");
062                    sb.append(actionIds);
063                    sb.append("}");
064    
065                    return sb.toString();
066            }
067    
068            @Override
069            public ResourceBlockPermission toEntityModel() {
070                    ResourceBlockPermissionImpl resourceBlockPermissionImpl = new ResourceBlockPermissionImpl();
071    
072                    resourceBlockPermissionImpl.setMvccVersion(mvccVersion);
073                    resourceBlockPermissionImpl.setResourceBlockPermissionId(resourceBlockPermissionId);
074                    resourceBlockPermissionImpl.setResourceBlockId(resourceBlockId);
075                    resourceBlockPermissionImpl.setRoleId(roleId);
076                    resourceBlockPermissionImpl.setActionIds(actionIds);
077    
078                    resourceBlockPermissionImpl.resetOriginalValues();
079    
080                    return resourceBlockPermissionImpl;
081            }
082    
083            @Override
084            public void readExternal(ObjectInput objectInput) throws IOException {
085                    mvccVersion = objectInput.readLong();
086                    resourceBlockPermissionId = objectInput.readLong();
087                    resourceBlockId = objectInput.readLong();
088                    roleId = objectInput.readLong();
089                    actionIds = objectInput.readLong();
090            }
091    
092            @Override
093            public void writeExternal(ObjectOutput objectOutput)
094                    throws IOException {
095                    objectOutput.writeLong(mvccVersion);
096                    objectOutput.writeLong(resourceBlockPermissionId);
097                    objectOutput.writeLong(resourceBlockId);
098                    objectOutput.writeLong(roleId);
099                    objectOutput.writeLong(actionIds);
100            }
101    
102            public long mvccVersion;
103            public long resourceBlockPermissionId;
104            public long resourceBlockId;
105            public long roleId;
106            public long actionIds;
107    }