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.Team;
021
022 import java.io.Serializable;
023
024 import java.util.Date;
025
026
033 public class TeamCacheModel implements CacheModel<Team>, Serializable {
034 @Override
035 public String toString() {
036 StringBundler sb = new StringBundler(19);
037
038 sb.append("{teamId=");
039 sb.append(teamId);
040 sb.append(", companyId=");
041 sb.append(companyId);
042 sb.append(", userId=");
043 sb.append(userId);
044 sb.append(", userName=");
045 sb.append(userName);
046 sb.append(", createDate=");
047 sb.append(createDate);
048 sb.append(", modifiedDate=");
049 sb.append(modifiedDate);
050 sb.append(", groupId=");
051 sb.append(groupId);
052 sb.append(", name=");
053 sb.append(name);
054 sb.append(", description=");
055 sb.append(description);
056 sb.append("}");
057
058 return sb.toString();
059 }
060
061 public Team toEntityModel() {
062 TeamImpl teamImpl = new TeamImpl();
063
064 teamImpl.setTeamId(teamId);
065 teamImpl.setCompanyId(companyId);
066 teamImpl.setUserId(userId);
067
068 if (userName == null) {
069 teamImpl.setUserName(StringPool.BLANK);
070 }
071 else {
072 teamImpl.setUserName(userName);
073 }
074
075 if (createDate == Long.MIN_VALUE) {
076 teamImpl.setCreateDate(null);
077 }
078 else {
079 teamImpl.setCreateDate(new Date(createDate));
080 }
081
082 if (modifiedDate == Long.MIN_VALUE) {
083 teamImpl.setModifiedDate(null);
084 }
085 else {
086 teamImpl.setModifiedDate(new Date(modifiedDate));
087 }
088
089 teamImpl.setGroupId(groupId);
090
091 if (name == null) {
092 teamImpl.setName(StringPool.BLANK);
093 }
094 else {
095 teamImpl.setName(name);
096 }
097
098 if (description == null) {
099 teamImpl.setDescription(StringPool.BLANK);
100 }
101 else {
102 teamImpl.setDescription(description);
103 }
104
105 teamImpl.resetOriginalValues();
106
107 return teamImpl;
108 }
109
110 public long teamId;
111 public long companyId;
112 public long userId;
113 public String userName;
114 public long createDate;
115 public long modifiedDate;
116 public long groupId;
117 public String name;
118 public String description;
119 }