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.UserGroupGroupRole;
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 UserGroupGroupRole in entity cache.
031     *
032     * @author Brian Wing Shun Chan
033     * @see UserGroupGroupRole
034     * @generated
035     */
036    @ProviderType
037    public class UserGroupGroupRoleCacheModel implements CacheModel<UserGroupGroupRole>,
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(9);
052    
053                    sb.append("{mvccVersion=");
054                    sb.append(mvccVersion);
055                    sb.append(", userGroupId=");
056                    sb.append(userGroupId);
057                    sb.append(", groupId=");
058                    sb.append(groupId);
059                    sb.append(", roleId=");
060                    sb.append(roleId);
061                    sb.append("}");
062    
063                    return sb.toString();
064            }
065    
066            @Override
067            public UserGroupGroupRole toEntityModel() {
068                    UserGroupGroupRoleImpl userGroupGroupRoleImpl = new UserGroupGroupRoleImpl();
069    
070                    userGroupGroupRoleImpl.setMvccVersion(mvccVersion);
071                    userGroupGroupRoleImpl.setUserGroupId(userGroupId);
072                    userGroupGroupRoleImpl.setGroupId(groupId);
073                    userGroupGroupRoleImpl.setRoleId(roleId);
074    
075                    userGroupGroupRoleImpl.resetOriginalValues();
076    
077                    return userGroupGroupRoleImpl;
078            }
079    
080            @Override
081            public void readExternal(ObjectInput objectInput) throws IOException {
082                    mvccVersion = objectInput.readLong();
083                    userGroupId = objectInput.readLong();
084                    groupId = objectInput.readLong();
085                    roleId = objectInput.readLong();
086            }
087    
088            @Override
089            public void writeExternal(ObjectOutput objectOutput)
090                    throws IOException {
091                    objectOutput.writeLong(mvccVersion);
092                    objectOutput.writeLong(userGroupId);
093                    objectOutput.writeLong(groupId);
094                    objectOutput.writeLong(roleId);
095            }
096    
097            public long mvccVersion;
098            public long userGroupId;
099            public long groupId;
100            public long roleId;
101    }