001
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
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 }