001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.BrowserTracker;
019    import com.liferay.portal.model.CacheModel;
020    
021    import java.io.Externalizable;
022    import java.io.IOException;
023    import java.io.ObjectInput;
024    import java.io.ObjectOutput;
025    
026    /**
027     * The cache model class for representing BrowserTracker in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see BrowserTracker
031     * @generated
032     */
033    public class BrowserTrackerCacheModel implements CacheModel<BrowserTracker>,
034            Externalizable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(7);
038    
039                    sb.append("{browserTrackerId=");
040                    sb.append(browserTrackerId);
041                    sb.append(", userId=");
042                    sb.append(userId);
043                    sb.append(", browserKey=");
044                    sb.append(browserKey);
045                    sb.append("}");
046    
047                    return sb.toString();
048            }
049    
050            @Override
051            public BrowserTracker toEntityModel() {
052                    BrowserTrackerImpl browserTrackerImpl = new BrowserTrackerImpl();
053    
054                    browserTrackerImpl.setBrowserTrackerId(browserTrackerId);
055                    browserTrackerImpl.setUserId(userId);
056                    browserTrackerImpl.setBrowserKey(browserKey);
057    
058                    browserTrackerImpl.resetOriginalValues();
059    
060                    return browserTrackerImpl;
061            }
062    
063            @Override
064            public void readExternal(ObjectInput objectInput) throws IOException {
065                    browserTrackerId = objectInput.readLong();
066                    userId = objectInput.readLong();
067                    browserKey = objectInput.readLong();
068            }
069    
070            @Override
071            public void writeExternal(ObjectOutput objectOutput)
072                    throws IOException {
073                    objectOutput.writeLong(browserTrackerId);
074                    objectOutput.writeLong(userId);
075                    objectOutput.writeLong(browserKey);
076            }
077    
078            public long browserTrackerId;
079            public long userId;
080            public long browserKey;
081    }