001
014
015 package com.liferay.portlet.softwarecatalog.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
023 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
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 SCProductScreenshotCacheModel implements CacheModel<SCProductScreenshot>,
039 Externalizable {
040 @Override
041 public boolean equals(Object obj) {
042 if (this == obj) {
043 return true;
044 }
045
046 if (!(obj instanceof SCProductScreenshotCacheModel)) {
047 return false;
048 }
049
050 SCProductScreenshotCacheModel scProductScreenshotCacheModel = (SCProductScreenshotCacheModel)obj;
051
052 if (productScreenshotId == scProductScreenshotCacheModel.productScreenshotId) {
053 return true;
054 }
055
056 return false;
057 }
058
059 @Override
060 public int hashCode() {
061 return HashUtil.hash(0, productScreenshotId);
062 }
063
064 @Override
065 public String toString() {
066 StringBundler sb = new StringBundler(15);
067
068 sb.append("{productScreenshotId=");
069 sb.append(productScreenshotId);
070 sb.append(", companyId=");
071 sb.append(companyId);
072 sb.append(", groupId=");
073 sb.append(groupId);
074 sb.append(", productEntryId=");
075 sb.append(productEntryId);
076 sb.append(", thumbnailId=");
077 sb.append(thumbnailId);
078 sb.append(", fullImageId=");
079 sb.append(fullImageId);
080 sb.append(", priority=");
081 sb.append(priority);
082 sb.append("}");
083
084 return sb.toString();
085 }
086
087 @Override
088 public SCProductScreenshot toEntityModel() {
089 SCProductScreenshotImpl scProductScreenshotImpl = new SCProductScreenshotImpl();
090
091 scProductScreenshotImpl.setProductScreenshotId(productScreenshotId);
092 scProductScreenshotImpl.setCompanyId(companyId);
093 scProductScreenshotImpl.setGroupId(groupId);
094 scProductScreenshotImpl.setProductEntryId(productEntryId);
095 scProductScreenshotImpl.setThumbnailId(thumbnailId);
096 scProductScreenshotImpl.setFullImageId(fullImageId);
097 scProductScreenshotImpl.setPriority(priority);
098
099 scProductScreenshotImpl.resetOriginalValues();
100
101 return scProductScreenshotImpl;
102 }
103
104 @Override
105 public void readExternal(ObjectInput objectInput) throws IOException {
106 productScreenshotId = objectInput.readLong();
107 companyId = objectInput.readLong();
108 groupId = objectInput.readLong();
109 productEntryId = objectInput.readLong();
110 thumbnailId = objectInput.readLong();
111 fullImageId = objectInput.readLong();
112 priority = objectInput.readInt();
113 }
114
115 @Override
116 public void writeExternal(ObjectOutput objectOutput)
117 throws IOException {
118 objectOutput.writeLong(productScreenshotId);
119 objectOutput.writeLong(companyId);
120 objectOutput.writeLong(groupId);
121 objectOutput.writeLong(productEntryId);
122 objectOutput.writeLong(thumbnailId);
123 objectOutput.writeLong(fullImageId);
124 objectOutput.writeInt(priority);
125 }
126
127 public long productScreenshotId;
128 public long companyId;
129 public long groupId;
130 public long productEntryId;
131 public long thumbnailId;
132 public long fullImageId;
133 public int priority;
134 }