001
014
015 package com.liferay.portal.model.impl;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.StringPool;
019 import com.liferay.portal.model.CacheModel;
020 import com.liferay.portal.model.RepositoryEntry;
021
022 import java.io.Externalizable;
023 import java.io.IOException;
024 import java.io.ObjectInput;
025 import java.io.ObjectOutput;
026
027
034 public class RepositoryEntryCacheModel implements CacheModel<RepositoryEntry>,
035 Externalizable {
036 @Override
037 public String toString() {
038 StringBundler sb = new StringBundler(13);
039
040 sb.append("{uuid=");
041 sb.append(uuid);
042 sb.append(", repositoryEntryId=");
043 sb.append(repositoryEntryId);
044 sb.append(", groupId=");
045 sb.append(groupId);
046 sb.append(", repositoryId=");
047 sb.append(repositoryId);
048 sb.append(", mappedId=");
049 sb.append(mappedId);
050 sb.append(", manualCheckInRequired=");
051 sb.append(manualCheckInRequired);
052 sb.append("}");
053
054 return sb.toString();
055 }
056
057 public RepositoryEntry toEntityModel() {
058 RepositoryEntryImpl repositoryEntryImpl = new RepositoryEntryImpl();
059
060 if (uuid == null) {
061 repositoryEntryImpl.setUuid(StringPool.BLANK);
062 }
063 else {
064 repositoryEntryImpl.setUuid(uuid);
065 }
066
067 repositoryEntryImpl.setRepositoryEntryId(repositoryEntryId);
068 repositoryEntryImpl.setGroupId(groupId);
069 repositoryEntryImpl.setRepositoryId(repositoryId);
070
071 if (mappedId == null) {
072 repositoryEntryImpl.setMappedId(StringPool.BLANK);
073 }
074 else {
075 repositoryEntryImpl.setMappedId(mappedId);
076 }
077
078 repositoryEntryImpl.setManualCheckInRequired(manualCheckInRequired);
079
080 repositoryEntryImpl.resetOriginalValues();
081
082 return repositoryEntryImpl;
083 }
084
085 public void readExternal(ObjectInput objectInput) throws IOException {
086 uuid = objectInput.readUTF();
087 repositoryEntryId = objectInput.readLong();
088 groupId = objectInput.readLong();
089 repositoryId = objectInput.readLong();
090 mappedId = objectInput.readUTF();
091 manualCheckInRequired = objectInput.readBoolean();
092 }
093
094 public void writeExternal(ObjectOutput objectOutput)
095 throws IOException {
096 if (uuid == null) {
097 objectOutput.writeUTF(StringPool.BLANK);
098 }
099 else {
100 objectOutput.writeUTF(uuid);
101 }
102
103 objectOutput.writeLong(repositoryEntryId);
104 objectOutput.writeLong(groupId);
105 objectOutput.writeLong(repositoryId);
106
107 if (mappedId == null) {
108 objectOutput.writeUTF(StringPool.BLANK);
109 }
110 else {
111 objectOutput.writeUTF(mappedId);
112 }
113
114 objectOutput.writeBoolean(manualCheckInRequired);
115 }
116
117 public String uuid;
118 public long repositoryEntryId;
119 public long groupId;
120 public long repositoryId;
121 public String mappedId;
122 public boolean manualCheckInRequired;
123 }