001    /**
002     * Copyright (c) 2000-2012 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.portlet.trash.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.trash.model.TrashVersion;
021    
022    import java.io.Externalizable;
023    import java.io.IOException;
024    import java.io.ObjectInput;
025    import java.io.ObjectOutput;
026    
027    /**
028     * The cache model class for representing TrashVersion in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see TrashVersion
032     * @generated
033     */
034    public class TrashVersionCacheModel implements CacheModel<TrashVersion>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(11);
039    
040                    sb.append("{versionId=");
041                    sb.append(versionId);
042                    sb.append(", entryId=");
043                    sb.append(entryId);
044                    sb.append(", classNameId=");
045                    sb.append(classNameId);
046                    sb.append(", classPK=");
047                    sb.append(classPK);
048                    sb.append(", status=");
049                    sb.append(status);
050                    sb.append("}");
051    
052                    return sb.toString();
053            }
054    
055            public TrashVersion toEntityModel() {
056                    TrashVersionImpl trashVersionImpl = new TrashVersionImpl();
057    
058                    trashVersionImpl.setVersionId(versionId);
059                    trashVersionImpl.setEntryId(entryId);
060                    trashVersionImpl.setClassNameId(classNameId);
061                    trashVersionImpl.setClassPK(classPK);
062                    trashVersionImpl.setStatus(status);
063    
064                    trashVersionImpl.resetOriginalValues();
065    
066                    return trashVersionImpl;
067            }
068    
069            public void readExternal(ObjectInput objectInput) throws IOException {
070                    versionId = objectInput.readLong();
071                    entryId = objectInput.readLong();
072                    classNameId = objectInput.readLong();
073                    classPK = objectInput.readLong();
074                    status = objectInput.readInt();
075            }
076    
077            public void writeExternal(ObjectOutput objectOutput)
078                    throws IOException {
079                    objectOutput.writeLong(versionId);
080                    objectOutput.writeLong(entryId);
081                    objectOutput.writeLong(classNameId);
082                    objectOutput.writeLong(classPK);
083                    objectOutput.writeInt(status);
084            }
085    
086            public long versionId;
087            public long entryId;
088            public long classNameId;
089            public long classPK;
090            public int status;
091    }