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            @Override
054            public AssetTagStats toEntityModel() {
055                    AssetTagStatsImpl assetTagStatsImpl = new AssetTagStatsImpl();
056    
057                    assetTagStatsImpl.setTagStatsId(tagStatsId);
058                    assetTagStatsImpl.setTagId(tagId);
059                    assetTagStatsImpl.setClassNameId(classNameId);
060                    assetTagStatsImpl.setAssetCount(assetCount);
061    
062                    assetTagStatsImpl.resetOriginalValues();
063    
064                    return assetTagStatsImpl;
065            }
066    
067            @Override
068            public void readExternal(ObjectInput objectInput) throws IOException {
069                    tagStatsId = objectInput.readLong();
070                    tagId = objectInput.readLong();
071                    classNameId = objectInput.readLong();
072                    assetCount = objectInput.readInt();
073            }
074    
075            @Override
076            public void writeExternal(ObjectOutput objectOutput)
077                    throws IOException {
078                    objectOutput.writeLong(tagStatsId);
079                    objectOutput.writeLong(tagId);
080                    objectOutput.writeLong(classNameId);
081                    objectOutput.writeInt(assetCount);
082            }
083    
084            public long tagStatsId;
085            public long tagId;
086            public long classNameId;
087            public int assetCount;
088    }