001    /**
002     * Copyright (c) 2000-2013 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            @Override
056            public TrashVersion toEntityModel() {
057                    TrashVersionImpl trashVersionImpl = new TrashVersionImpl();
058    
059                    trashVersionImpl.setVersionId(versionId);
060                    trashVersionImpl.setEntryId(entryId);
061                    trashVersionImpl.setClassNameId(classNameId);
062                    trashVersionImpl.setClassPK(classPK);
063                    trashVersionImpl.setStatus(status);
064    
065                    trashVersionImpl.resetOriginalValues();
066    
067                    return trashVersionImpl;
068            }
069    
070            @Override
071            public void readExternal(ObjectInput objectInput) throws IOException {
072                    versionId = objectInput.readLong();
073                    entryId = objectInput.readLong();
074                    classNameId = objectInput.readLong();
075                    classPK = objectInput.readLong();
076                    status = objectInput.readInt();
077            }
078    
079            @Override
080            public void writeExternal(ObjectOutput objectOutput)
081                    throws IOException {
082                    objectOutput.writeLong(versionId);
083                    objectOutput.writeLong(entryId);
084                    objectOutput.writeLong(classNameId);
085                    objectOutput.writeLong(classPK);
086                    objectOutput.writeInt(status);
087            }
088    
089            public long versionId;
090            public long entryId;
091            public long classNameId;
092            public long classPK;
093            public int status;
094    }