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.portal.model.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.model.BrowserTracker;
021    import com.liferay.portal.model.CacheModel;
022    import com.liferay.portal.model.MVCCModel;
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 BrowserTracker in entity cache.
031     *
032     * @author Brian Wing Shun Chan
033     * @see BrowserTracker
034     * @generated
035     */
036    @ProviderType
037    public class BrowserTrackerCacheModel implements CacheModel<BrowserTracker>,
038            Externalizable, MVCCModel {
039            @Override
040            public long getMvccVersion() {
041                    return mvccVersion;
042            }
043    
044            @Override
045            public void setMvccVersion(long mvccVersion) {
046                    this.mvccVersion = mvccVersion;
047            }
048    
049            @Override
050            public String toString() {
051                    StringBundler sb = new StringBundler(9);
052    
053                    sb.append("{mvccVersion=");
054                    sb.append(mvccVersion);
055                    sb.append(", browserTrackerId=");
056                    sb.append(browserTrackerId);
057                    sb.append(", userId=");
058                    sb.append(userId);
059                    sb.append(", browserKey=");
060                    sb.append(browserKey);
061                    sb.append("}");
062    
063                    return sb.toString();
064            }
065    
066            @Override
067            public BrowserTracker toEntityModel() {
068                    BrowserTrackerImpl browserTrackerImpl = new BrowserTrackerImpl();
069    
070                    browserTrackerImpl.setMvccVersion(mvccVersion);
071                    browserTrackerImpl.setBrowserTrackerId(browserTrackerId);
072                    browserTrackerImpl.setUserId(userId);
073                    browserTrackerImpl.setBrowserKey(browserKey);
074    
075                    browserTrackerImpl.resetOriginalValues();
076    
077                    return browserTrackerImpl;
078            }
079    
080            @Override
081            public void readExternal(ObjectInput objectInput) throws IOException {
082                    mvccVersion = objectInput.readLong();
083                    browserTrackerId = objectInput.readLong();
084                    userId = objectInput.readLong();
085                    browserKey = objectInput.readLong();
086            }
087    
088            @Override
089            public void writeExternal(ObjectOutput objectOutput)
090                    throws IOException {
091                    objectOutput.writeLong(mvccVersion);
092                    objectOutput.writeLong(browserTrackerId);
093                    objectOutput.writeLong(userId);
094                    objectOutput.writeLong(browserKey);
095            }
096    
097            public long mvccVersion;
098            public long browserTrackerId;
099            public long userId;
100            public long browserKey;
101    }