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.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.WebDAVProps;
021    
022    import java.io.Serializable;
023    
024    import java.util.Date;
025    
026    /**
027     * The cache model class for representing WebDAVProps in entity cache.
028     *
029     * @author Brian Wing Shun Chan
030     * @see WebDAVProps
031     * @generated
032     */
033    public class WebDAVPropsCacheModel implements CacheModel<WebDAVProps>,
034            Serializable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(15);
038    
039                    sb.append("{webDavPropsId=");
040                    sb.append(webDavPropsId);
041                    sb.append(", companyId=");
042                    sb.append(companyId);
043                    sb.append(", createDate=");
044                    sb.append(createDate);
045                    sb.append(", modifiedDate=");
046                    sb.append(modifiedDate);
047                    sb.append(", classNameId=");
048                    sb.append(classNameId);
049                    sb.append(", classPK=");
050                    sb.append(classPK);
051                    sb.append(", props=");
052                    sb.append(props);
053                    sb.append("}");
054    
055                    return sb.toString();
056            }
057    
058            public WebDAVProps toEntityModel() {
059                    WebDAVPropsImpl webDAVPropsImpl = new WebDAVPropsImpl();
060    
061                    webDAVPropsImpl.setWebDavPropsId(webDavPropsId);
062                    webDAVPropsImpl.setCompanyId(companyId);
063    
064                    if (createDate == Long.MIN_VALUE) {
065                            webDAVPropsImpl.setCreateDate(null);
066                    }
067                    else {
068                            webDAVPropsImpl.setCreateDate(new Date(createDate));
069                    }
070    
071                    if (modifiedDate == Long.MIN_VALUE) {
072                            webDAVPropsImpl.setModifiedDate(null);
073                    }
074                    else {
075                            webDAVPropsImpl.setModifiedDate(new Date(modifiedDate));
076                    }
077    
078                    webDAVPropsImpl.setClassNameId(classNameId);
079                    webDAVPropsImpl.setClassPK(classPK);
080    
081                    if (props == null) {
082                            webDAVPropsImpl.setProps(StringPool.BLANK);
083                    }
084                    else {
085                            webDAVPropsImpl.setProps(props);
086                    }
087    
088                    webDAVPropsImpl.resetOriginalValues();
089    
090                    return webDAVPropsImpl;
091            }
092    
093            public long webDavPropsId;
094            public long companyId;
095            public long createDate;
096            public long modifiedDate;
097            public long classNameId;
098            public long classPK;
099            public String props;
100    }