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