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