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.asset.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.asset.model.AssetTagStats;
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 AssetTagStats in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see AssetTagStats
032     * @generated
033     */
034    public class AssetTagStatsCacheModel implements CacheModel<AssetTagStats>,
035            Externalizable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(9);
039    
040                    sb.append("{tagStatsId=");
041                    sb.append(tagStatsId);
042                    sb.append(", tagId=");
043                    sb.append(tagId);
044                    sb.append(", classNameId=");
045                    sb.append(classNameId);
046                    sb.append(", assetCount=");
047                    sb.append(assetCount);
048                    sb.append("}");
049    
050                    return sb.toString();
051            }
052    
053            public AssetTagStats toEntityModel() {
054                    AssetTagStatsImpl assetTagStatsImpl = new AssetTagStatsImpl();
055    
056                    assetTagStatsImpl.setTagStatsId(tagStatsId);
057                    assetTagStatsImpl.setTagId(tagId);
058                    assetTagStatsImpl.setClassNameId(classNameId);
059                    assetTagStatsImpl.setAssetCount(assetCount);
060    
061                    assetTagStatsImpl.resetOriginalValues();
062    
063                    return assetTagStatsImpl;
064            }
065    
066            public void readExternal(ObjectInput objectInput) throws IOException {
067                    tagStatsId = objectInput.readLong();
068                    tagId = objectInput.readLong();
069                    classNameId = objectInput.readLong();
070                    assetCount = objectInput.readInt();
071            }
072    
073            public void writeExternal(ObjectOutput objectOutput)
074                    throws IOException {
075                    objectOutput.writeLong(tagStatsId);
076                    objectOutput.writeLong(tagId);
077                    objectOutput.writeLong(classNameId);
078                    objectOutput.writeInt(assetCount);
079            }
080    
081            public long tagStatsId;
082            public long tagId;
083            public long classNameId;
084            public int assetCount;
085    }