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.RecentLayoutBranch;
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 RecentLayoutBranch in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see RecentLayoutBranch
035     * @generated
036     */
037    @ProviderType
038    public class RecentLayoutBranchCacheModel implements CacheModel<RecentLayoutBranch>,
039            Externalizable, MVCCModel {
040            @Override
041            public boolean equals(Object obj) {
042                    if (this == obj) {
043                            return true;
044                    }
045    
046                    if (!(obj instanceof RecentLayoutBranchCacheModel)) {
047                            return false;
048                    }
049    
050                    RecentLayoutBranchCacheModel recentLayoutBranchCacheModel = (RecentLayoutBranchCacheModel)obj;
051    
052                    if ((recentLayoutBranchId == recentLayoutBranchCacheModel.recentLayoutBranchId) &&
053                                    (mvccVersion == recentLayoutBranchCacheModel.mvccVersion)) {
054                            return true;
055                    }
056    
057                    return false;
058            }
059    
060            @Override
061            public int hashCode() {
062                    int hashCode = HashUtil.hash(0, recentLayoutBranchId);
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(17);
080    
081                    sb.append("{mvccVersion=");
082                    sb.append(mvccVersion);
083                    sb.append(", recentLayoutBranchId=");
084                    sb.append(recentLayoutBranchId);
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(", layoutBranchId=");
092                    sb.append(layoutBranchId);
093                    sb.append(", layoutSetBranchId=");
094                    sb.append(layoutSetBranchId);
095                    sb.append(", plid=");
096                    sb.append(plid);
097                    sb.append("}");
098    
099                    return sb.toString();
100            }
101    
102            @Override
103            public RecentLayoutBranch toEntityModel() {
104                    RecentLayoutBranchImpl recentLayoutBranchImpl = new RecentLayoutBranchImpl();
105    
106                    recentLayoutBranchImpl.setMvccVersion(mvccVersion);
107                    recentLayoutBranchImpl.setRecentLayoutBranchId(recentLayoutBranchId);
108                    recentLayoutBranchImpl.setGroupId(groupId);
109                    recentLayoutBranchImpl.setCompanyId(companyId);
110                    recentLayoutBranchImpl.setUserId(userId);
111                    recentLayoutBranchImpl.setLayoutBranchId(layoutBranchId);
112                    recentLayoutBranchImpl.setLayoutSetBranchId(layoutSetBranchId);
113                    recentLayoutBranchImpl.setPlid(plid);
114    
115                    recentLayoutBranchImpl.resetOriginalValues();
116    
117                    return recentLayoutBranchImpl;
118            }
119    
120            @Override
121            public void readExternal(ObjectInput objectInput) throws IOException {
122                    mvccVersion = objectInput.readLong();
123                    recentLayoutBranchId = objectInput.readLong();
124                    groupId = objectInput.readLong();
125                    companyId = objectInput.readLong();
126                    userId = objectInput.readLong();
127                    layoutBranchId = objectInput.readLong();
128                    layoutSetBranchId = objectInput.readLong();
129                    plid = objectInput.readLong();
130            }
131    
132            @Override
133            public void writeExternal(ObjectOutput objectOutput)
134                    throws IOException {
135                    objectOutput.writeLong(mvccVersion);
136                    objectOutput.writeLong(recentLayoutBranchId);
137                    objectOutput.writeLong(groupId);
138                    objectOutput.writeLong(companyId);
139                    objectOutput.writeLong(userId);
140                    objectOutput.writeLong(layoutBranchId);
141                    objectOutput.writeLong(layoutSetBranchId);
142                    objectOutput.writeLong(plid);
143            }
144    
145            public long mvccVersion;
146            public long recentLayoutBranchId;
147            public long groupId;
148            public long companyId;
149            public long userId;
150            public long layoutBranchId;
151            public long layoutSetBranchId;
152            public long plid;
153    }