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.softwarecatalog.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
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 SCProductScreenshot in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see SCProductScreenshot
032     * @generated
033     */
034    public class SCProductScreenshotCacheModel implements CacheModel<SCProductScreenshot>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(15);
039    
040                    sb.append("{productScreenshotId=");
041                    sb.append(productScreenshotId);
042                    sb.append(", companyId=");
043                    sb.append(companyId);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", productEntryId=");
047                    sb.append(productEntryId);
048                    sb.append(", thumbnailId=");
049                    sb.append(thumbnailId);
050                    sb.append(", fullImageId=");
051                    sb.append(fullImageId);
052                    sb.append(", priority=");
053                    sb.append(priority);
054                    sb.append("}");
055    
056                    return sb.toString();
057            }
058    
059            @Override
060            public SCProductScreenshot toEntityModel() {
061                    SCProductScreenshotImpl scProductScreenshotImpl = new SCProductScreenshotImpl();
062    
063                    scProductScreenshotImpl.setProductScreenshotId(productScreenshotId);
064                    scProductScreenshotImpl.setCompanyId(companyId);
065                    scProductScreenshotImpl.setGroupId(groupId);
066                    scProductScreenshotImpl.setProductEntryId(productEntryId);
067                    scProductScreenshotImpl.setThumbnailId(thumbnailId);
068                    scProductScreenshotImpl.setFullImageId(fullImageId);
069                    scProductScreenshotImpl.setPriority(priority);
070    
071                    scProductScreenshotImpl.resetOriginalValues();
072    
073                    return scProductScreenshotImpl;
074            }
075    
076            @Override
077            public void readExternal(ObjectInput objectInput) throws IOException {
078                    productScreenshotId = objectInput.readLong();
079                    companyId = objectInput.readLong();
080                    groupId = objectInput.readLong();
081                    productEntryId = objectInput.readLong();
082                    thumbnailId = objectInput.readLong();
083                    fullImageId = objectInput.readLong();
084                    priority = objectInput.readInt();
085            }
086    
087            @Override
088            public void writeExternal(ObjectOutput objectOutput)
089                    throws IOException {
090                    objectOutput.writeLong(productScreenshotId);
091                    objectOutput.writeLong(companyId);
092                    objectOutput.writeLong(groupId);
093                    objectOutput.writeLong(productEntryId);
094                    objectOutput.writeLong(thumbnailId);
095                    objectOutput.writeLong(fullImageId);
096                    objectOutput.writeInt(priority);
097            }
098    
099            public long productScreenshotId;
100            public long companyId;
101            public long groupId;
102            public long productEntryId;
103            public long thumbnailId;
104            public long fullImageId;
105            public int priority;
106    }