001
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.RecentLayoutRevision;
024
025 import java.io.Externalizable;
026 import java.io.IOException;
027 import java.io.ObjectInput;
028 import java.io.ObjectOutput;
029
030
037 @ProviderType
038 public class RecentLayoutRevisionCacheModel implements CacheModel<RecentLayoutRevision>,
039 Externalizable, MVCCModel {
040 @Override
041 public boolean equals(Object obj) {
042 if (this == obj) {
043 return true;
044 }
045
046 if (!(obj instanceof RecentLayoutRevisionCacheModel)) {
047 return false;
048 }
049
050 RecentLayoutRevisionCacheModel recentLayoutRevisionCacheModel = (RecentLayoutRevisionCacheModel)obj;
051
052 if ((recentLayoutRevisionId == recentLayoutRevisionCacheModel.recentLayoutRevisionId) &&
053 (mvccVersion == recentLayoutRevisionCacheModel.mvccVersion)) {
054 return true;
055 }
056
057 return false;
058 }
059
060 @Override
061 public int hashCode() {
062 int hashCode = HashUtil.hash(0, recentLayoutRevisionId);
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(", recentLayoutRevisionId=");
084 sb.append(recentLayoutRevisionId);
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(", layoutRevisionId=");
092 sb.append(layoutRevisionId);
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 RecentLayoutRevision toEntityModel() {
104 RecentLayoutRevisionImpl recentLayoutRevisionImpl = new RecentLayoutRevisionImpl();
105
106 recentLayoutRevisionImpl.setMvccVersion(mvccVersion);
107 recentLayoutRevisionImpl.setRecentLayoutRevisionId(recentLayoutRevisionId);
108 recentLayoutRevisionImpl.setGroupId(groupId);
109 recentLayoutRevisionImpl.setCompanyId(companyId);
110 recentLayoutRevisionImpl.setUserId(userId);
111 recentLayoutRevisionImpl.setLayoutRevisionId(layoutRevisionId);
112 recentLayoutRevisionImpl.setLayoutSetBranchId(layoutSetBranchId);
113 recentLayoutRevisionImpl.setPlid(plid);
114
115 recentLayoutRevisionImpl.resetOriginalValues();
116
117 return recentLayoutRevisionImpl;
118 }
119
120 @Override
121 public void readExternal(ObjectInput objectInput) throws IOException {
122 mvccVersion = objectInput.readLong();
123 recentLayoutRevisionId = objectInput.readLong();
124 groupId = objectInput.readLong();
125 companyId = objectInput.readLong();
126 userId = objectInput.readLong();
127 layoutRevisionId = 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(recentLayoutRevisionId);
137 objectOutput.writeLong(groupId);
138 objectOutput.writeLong(companyId);
139 objectOutput.writeLong(userId);
140 objectOutput.writeLong(layoutRevisionId);
141 objectOutput.writeLong(layoutSetBranchId);
142 objectOutput.writeLong(plid);
143 }
144
145 public long mvccVersion;
146 public long recentLayoutRevisionId;
147 public long groupId;
148 public long companyId;
149 public long userId;
150 public long layoutRevisionId;
151 public long layoutSetBranchId;
152 public long plid;
153 }