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.HashUtil;
020    import com.liferay.portal.kernel.util.StringBundler;
021    import com.liferay.portal.model.CacheModel;
022    import com.liferay.portal.model.MVCCModel;
023    import com.liferay.portal.model.RecentLayoutSetBranch;
024    
025    import java.io.Externalizable;
026    import java.io.IOException;
027    import java.io.ObjectInput;
028    import java.io.ObjectOutput;
029    
030    /**
031     * The cache model class for representing RecentLayoutSetBranch in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see RecentLayoutSetBranch
035     * @generated
036     */
037    @ProviderType
038    public class RecentLayoutSetBranchCacheModel implements CacheModel<RecentLayoutSetBranch>,
039            Externalizable, MVCCModel {
040            @Override
041            public boolean equals(Object obj) {
042                    if (this == obj) {
043                            return true;
044                    }
045    
046                    if (!(obj instanceof RecentLayoutSetBranchCacheModel)) {
047                            return false;
048                    }
049    
050                    RecentLayoutSetBranchCacheModel recentLayoutSetBranchCacheModel = (RecentLayoutSetBranchCacheModel)obj;
051    
052                    if ((recentLayoutSetBranchId == recentLayoutSetBranchCacheModel.recentLayoutSetBranchId) &&
053                                    (mvccVersion == recentLayoutSetBranchCacheModel.mvccVersion)) {
054                            return true;
055                    }
056    
057                    return false;
058            }
059    
060            @Override
061            public int hashCode() {
062                    int hashCode = HashUtil.hash(0, recentLayoutSetBranchId);
063    
064                    return HashUtil.hash(hashCode, mvccVersion);
065            }
066    
067            @Override
068            public long getMvccVersion() {
069                    return mvccVersion;
070            }
071    
072            @Override
073            public void setMvccVersion(long mvccVersion) {
074                    this.mvccVersion = mvccVersion;
075            }
076    
077            @Override
078            public String toString() {
079                    StringBundler sb = new StringBundler(15);
080    
081                    sb.append("{mvccVersion=");
082                    sb.append(mvccVersion);
083                    sb.append(", recentLayoutSetBranchId=");
084                    sb.append(recentLayoutSetBranchId);
085                    sb.append(", groupId=");
086                    sb.append(groupId);
087                    sb.append(", companyId=");
088                    sb.append(companyId);
089                    sb.append(", userId=");
090                    sb.append(userId);
091                    sb.append(", layoutSetBranchId=");
092                    sb.append(layoutSetBranchId);
093                    sb.append(", layoutSetId=");
094                    sb.append(layoutSetId);
095                    sb.append("}");
096    
097                    return sb.toString();
098            }
099    
100            @Override
101            public RecentLayoutSetBranch toEntityModel() {
102                    RecentLayoutSetBranchImpl recentLayoutSetBranchImpl = new RecentLayoutSetBranchImpl();
103    
104                    recentLayoutSetBranchImpl.setMvccVersion(mvccVersion);
105                    recentLayoutSetBranchImpl.setRecentLayoutSetBranchId(recentLayoutSetBranchId);
106                    recentLayoutSetBranchImpl.setGroupId(groupId);
107                    recentLayoutSetBranchImpl.setCompanyId(companyId);
108                    recentLayoutSetBranchImpl.setUserId(userId);
109                    recentLayoutSetBranchImpl.setLayoutSetBranchId(layoutSetBranchId);
110                    recentLayoutSetBranchImpl.setLayoutSetId(layoutSetId);
111    
112                    recentLayoutSetBranchImpl.resetOriginalValues();
113    
114                    return recentLayoutSetBranchImpl;
115            }
116    
117            @Override
118            public void readExternal(ObjectInput objectInput) throws IOException {
119                    mvccVersion = objectInput.readLong();
120                    recentLayoutSetBranchId = objectInput.readLong();
121                    groupId = objectInput.readLong();
122                    companyId = objectInput.readLong();
123                    userId = objectInput.readLong();
124                    layoutSetBranchId = objectInput.readLong();
125                    layoutSetId = objectInput.readLong();
126            }
127    
128            @Override
129            public void writeExternal(ObjectOutput objectOutput)
130                    throws IOException {
131                    objectOutput.writeLong(mvccVersion);
132                    objectOutput.writeLong(recentLayoutSetBranchId);
133                    objectOutput.writeLong(groupId);
134                    objectOutput.writeLong(companyId);
135                    objectOutput.writeLong(userId);
136                    objectOutput.writeLong(layoutSetBranchId);
137                    objectOutput.writeLong(layoutSetId);
138            }
139    
140            public long mvccVersion;
141            public long recentLayoutSetBranchId;
142            public long groupId;
143            public long companyId;
144            public long userId;
145            public long layoutSetBranchId;
146            public long layoutSetId;
147    }