001    /**
002     * Copyright (c) 2000-2011 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.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    import com.liferay.portal.model.UserTrackerPath;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing UserTrackerPath in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see UserTrackerPath
031     * @generated
032     */
033    public class UserTrackerPathCacheModel implements CacheModel<UserTrackerPath>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(9);
038    
039                    sb.append("{userTrackerPathId=");
040                    sb.append(userTrackerPathId);
041                    sb.append(", userTrackerId=");
042                    sb.append(userTrackerId);
043                    sb.append(", path=");
044                    sb.append(path);
045                    sb.append(", pathDate=");
046                    sb.append(pathDate);
047                    sb.append("}");
048    
049                    return sb.toString();
050            }
051    
052            public UserTrackerPath toEntityModel() {
053                    UserTrackerPathImpl userTrackerPathImpl = new UserTrackerPathImpl();
054    
055                    userTrackerPathImpl.setUserTrackerPathId(userTrackerPathId);
056                    userTrackerPathImpl.setUserTrackerId(userTrackerId);
057    
058                    if (path == null) {
059                            userTrackerPathImpl.setPath(StringPool.BLANK);
060                    }
061                    else {
062                            userTrackerPathImpl.setPath(path);
063                    }
064    
065                    if (pathDate == Long.MIN_VALUE) {
066                            userTrackerPathImpl.setPathDate(null);
067                    }
068                    else {
069                            userTrackerPathImpl.setPathDate(new Date(pathDate));
070                    }
071    
072                    userTrackerPathImpl.resetOriginalValues();
073    
074                    return userTrackerPathImpl;
075            }
076    
077            public long userTrackerPathId;
078            public long userTrackerId;
079            public String path;
080            public long pathDate;
081    }